The PostgreSQL
JDBC Interface

Table of Contents

1. Introduction
2. Setting up the JDBC Driver
Getting the Driver
Setting up the Class Path
Preparing the Database Server for JDBC
Creating a Database
3. Initializing the Driver
Importing JDBC
Loading the Driver
Connecting to the Database
Connection Parameters
4. Using SSL
Configuring the Server
Configuring the Client
Using SSL without Certificate Validation
Custom SSLSocketFactory
5. Issuing a Query and Processing the Result
Getting results based on a cursor
Using the Statement or PreparedStatement Interface
Using the ResultSet Interface
Performing Updates
Creating and Modifying Database Objects
6. Calling Stored Functions
Obtaining a ResultSet from a stored function
From a Function Returing SETOF type
From a Function Returing a refcursor
7. Storing Binary Data
8. JDBC escapes
Escape for like escape character
Escape for outer joins
Date-time escapes
Escaped scalar functions
9. PostgreSQL™ Extensions to the JDBC API
Accessing the Extensions
Geometric Data Types
Large Objects
Listen / Notify
Server Prepared Statements
10. Using the Driver in a Multithreaded or a Servlet Environment
11. Connection Pools and Data Sources
Application Servers: ConnectionPoolDataSource
Applications: DataSource
Tomcat setup
Data Sources and JNDI
12. Further Reading

List of Tables

8.1. Supported escaped numeric functions
8.2. Supported escaped string functions
8.3. Supported escaped date/time functions
8.4. Supported escaped misc functions
11.1. ConnectionPoolDataSource Configuration Properties
11.2. DataSource Implementations
11.3. DataSource Configuration Properties
11.4. Additional Pooling DataSource Configuration Properties

List of Examples

5.1. Processing a Simple Query in JDBC
5.2. Setting fetch size to turn cursors on and off.
5.3. Deleting Rows in JDBC
5.4. Dropping a Table in JDBC
6.1. Calling a built in stored function
6.2. Getting SETOF type values from a function
6.3. Getting refcursor Value From a Function
6.4. Treating refcursor as a cursor name
7.1. Processing Binary Data in JDBC
8.1. Using jdbc escapes
9.1. Using the circle datatype from JDBC
9.2. Receiving Notifications
9.3. Using server side prepared statements
11.1. DataSource Code Example
11.2. DataSource JNDI Code Example