talira

PostgreSQL JDBC Driver

The open source JDBC driver for PostgreSQL, in pure Java

open sourceBSD-2-Clausefree

The PostgreSQL JDBC Driver (pgJDBC) lets Java programs connect to a PostgreSQL database using standard, database-independent JDBC code. It's a Type 4 driver written in pure Java that speaks PostgreSQL's native network protocol, so it runs on any system once compiled, and it implements most of the JDBC specification plus PostgreSQL-specific extensions. Connection properties cover SSL and its modes, SCRAM, GSSAPI and SSPI authentication, adaptive fetch sizes and more. It's the org.postgresql:postgresql artifact on Maven Central and is maintained under the PostgreSQL Global Development Group.

Problems it solves

  • connect my Java application to a PostgreSQL database
  • use PostgreSQL from Spring, Hibernate or another JVM framework
  • query Postgres from Kotlin or Scala over JDBC

Features

  • Type 4 driver in pure Java, platform independent
  • JDBC 4.2 with PostgreSQL-specific extensions
  • SSL with configurable sslmode and client certificates
  • SCRAM-SHA-256, GSSAPI and SSPI authentication
  • adaptive fetch size

Limitations

  • Needs Java 8 (JDBC 4.2) or later, and PostgreSQL 8.4 or later1

Alternatives

The same job

These do what PostgreSQL JDBC Driver does.

  1. SQLite JDBC Driver A JDBC driver for SQLite with native libraries bundled in one JAR
  2. MongoDB Java Driver MongoDB's official drivers for Java, Kotlin and Scala

Compare PostgreSQL JDBC Driver with the top 3