Table of Contents
- Setting up the JDBC Driver
- Initializing the Driver
- Using SSL
- Issuing a Query and Processing the Result
- Calling Stored Functions and Procedures
- Storing Binary Data
- JDBC escapes
- PostgreSQL Extensions to the JDBC API
- Using the Driver in a Multithreaded or a Servlet Environment
- Connection Pools and Data Sources
- Logging using java.util.logging
- Further Reading
Java Database Connectivity (JDBC) is an application programming interface (API) for the programming language Java, which defines how a client may access a database. It is part of the Java Standard Edition platform and provides methods to query and update data in a database, and is oriented towards relational databases.
PostgreSQL JDBC Driver (pgJDBC for short) allows Java programs to connect to a PostgreSQL database using standard, database independent Java code. Is an open source JDBC driver written in Pure Java (Type 4), and communicates in the PostgreSQL native network protocol. Because of this, the driver is platform independent; once compiled, the driver can be used on any system.
The current version of the driver should be compatible with PostgreSQL 8.2 and higher using the version 3.0 of the PostgreSQL protocol, and it’s compatible with Java 8 (JDBC 4.2) and above.
This manual is not intended as a complete guide to JDBC programming, but should help to get you started. For more information refer to the standard JDBC API documentation. Also, take a look at the examples included with the source.