File: ext.md

package info (click to toggle)
libpgjava 42.2.5-2%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 8,136 kB
  • sloc: java: 57,821; xml: 1,135; sh: 307; perl: 99; makefile: 7
file content (36 lines) | stat: -rw-r--r-- 1,364 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
---
layout: default_docs
title: Chapter 9. PostgreSQL™ Extensions to the JDBC API
header: Chapter 9. PostgreSQL™ Extensions to the JDBC API
resource: media
previoustitle: Escaped scalar functions
previous: escaped-functions.html
nexttitle: Geometric Data Types
next: geometric.html
---

**Table of Contents**

* [Accessing the Extensions](ext.html#extensions)
* [Geometric Data Types](geometric.html)
* [Large Objects](largeobjects.html)
* [Listen / Notify](listennotify.html)
* [Server Prepared Statements](server-prepare.html)

PostgreSQL™ is an extensible database system. You can add your own functions to
the server, which can then be called from queries, or even add your own data types.
As these are facilities unique to PostgreSQL™, we support them from Java, with a
set of extension APIs. Some features within the core of the standard driver
actually use these extensions to implement Large Objects, etc.

<a name="extensions"></a>
# Accessing the Extensions

To access some of the extensions, you need to use some extra methods in the
`org.postgresql.PGConnection` class. In this case, you would need to case the
return value of `Driver.getConnection()`. For example:

`Connection db = Driver.getConnection(url, username, password);`  
`// ...`  
`// later on`  
`Fastpath fp = db.unwrap(org.postgresql.PGConnection.class).getFastpathAPI();`