Files
2020-06-30 14:58:21 +08:00

1.3 KiB

layout, title, header, resource, previoustitle, previous, nexttitle, next
layout title header resource previoustitle previous nexttitle next
default_docs Chapter 9. PostgreSQL™ Extensions to the JDBC API Chapter 9. PostgreSQL™ Extensions to the JDBC API media Escaped scalar functions escaped-functions.html Geometric Data Types geometric.html

Table of Contents

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.

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();