Documentation
pgJDBC is the official JDBC driver for PostgreSQL®: pure Java, JDBC 4.2, production-grade. This documentation is organised by task: start with the section that matches what you need to do.
If you already know your way around JDBC and just want the knobs, jump straight to Connection properties for the complete catalogue, or to Recommended properties for the short list of non-default settings worth turning on in production.
If you are evaluating pgJDBC for a new project, go to
Getting started
for the
Maven/Gradle dependency and a TLS-protected first connection. To check
that your Java runtime and PostgreSQL server match a supported driver
line, see Compatibility
;
for the PostgreSQL server-side checks (TCP listener, pg_hba.conf,
database encoding), see Server preparation
.
- Getting started Add pgJDBC to a project, prepare the database server, and open the first connection.
- Reference Generated catalogue of every connection property, with defaults, types, and the version each was introduced in.
- Connect JDBC URL syntax, recommended non-default settings, timeouts, connection pooling, Unix sockets, multi-host fail-over, and integration with connection pools.
- Security TLS, authentication mechanisms, and the recommended security baseline for production connections.
- Query Issuing SQL, prepared statements, cursor-based fetching, stored procedures, escape syntax.
- Data types How PostgreSQL types map to Java types: date/time, binary data, arrays, large objects, geometric types.
- PostgreSQL features PostgreSQL-specific functionality reached via PGConnection: COPY, LISTEN/NOTIFY, replication, parameter status.
- Runtime JVM-environment specifics: logging configuration, future GraalVM / JPMS / OSGi / Android notes.
- Troubleshooting Diagnoses for common pgJDBC failure modes, indexed by symptom and error message.