elephant

PostgreSQL JDBC Driver

An Open source JDBC driver written in Pure Java (Type 4), which communicates using the PostgreSQL native network protocol

Why pgJDBC?

The PostgreSQL JDBC Driver allows Java programs to connect to a PostgreSQL database using standard, database independent Java code. pgJDBC 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.

Latest Releases

pgJDBC has released v42.7.3, v42.6.2, v42.5.6, v42.4.5, v42.3.10 and v42.2.29 on March 13, 2024. These releases fix a problem running on Java 8 java.lang.NoSuchMethodError: java.nio.ByteBuffer.position()
All releases have been released using Java 8
One small fix to deal with all well known types in SimpleQuery mode

  • 42.7.4 · 20 August 2024 · Notes
  • 42.7.3 · 14 March 2024 · Notes
  • 42.6.2 · 13 March 2024 · Notes
  • 42.5.6 · 13 March 2024 · Notes
  • 42.4.5 · 13 March 2024 · Notes
  • 42.3.10 · 13 March 2024 · Notes
  • 42.2.29 · 13 March 2024 · Notes
feature

pgJDBC allows Java programs to connect to a PostgreSQL database using standard, database independent Java code.

feature

pgJDBC provides a reasonably complete implementation of the JDBC specification in addition to some PostgreSQL specific extensions.

feature

The current development driver supports eleven server versions and three java environments.

Processing a simple query

This example will issue a simple query and print out the first column of each row using a Statement.

Statement st = conn.createStatement();
ResultSet rs = st.executeQuery("SELECT * FROM mytable WHERE columnfoo = 500");
while (rs.next()) {
    System.out.print("Column 1 returned ");
    System.out.println(rs.getString(1));
}
rs.close();
st.close();

Report a bug or Contribute ?

support

Support Us

PostgreSQL is free.
Please support our work by making a donation.