A new JDBC driver for PostgreSQL aimed at supporting the advanced features of JDBC and Postgres
Go to file
David Wheeler 66f35adeaf
Netty & gradle upgrade (#605)
2024-06-21 15:24:50 +10:00
.github/workflows Bump some versions to get it to build 2024-05-30 17:22:43 -07:00
.idea Netty & gradle upgrade (#605) 2024-06-21 15:24:50 +10:00
buildSrc Netty & gradle upgrade (#605) 2024-06-21 15:24:50 +10:00
config Embed SASL/SCRAM library to incorporate compatibility fixes 2020-10-26 13:43:43 -07:00
documentation Make the gitPublish task depend directly on the other tasks (vs the folders) to make Gradle aware of the task dependencies (#602) 2024-06-04 09:36:07 +10:00
driver Update test certs to use rsa:2048 (#601) 2024-06-03 08:49:47 +10:00
gradle/wrapper Netty & gradle upgrade (#605) 2024-06-21 15:24:50 +10:00
settings-gen Set Kotlin compile version to match java version 2024-05-30 17:22:43 -07:00
shared/src/build Update Shadow plugin to 7.0.0 2021-06-02 08:36:40 -07:00
spy Update build to Gradle 7 & Lock Compiler to Java 1.8 2021-06-02 08:36:40 -07:00
udt-gen Set Kotlin compile version to match java version 2024-05-30 17:22:43 -07:00
verify Add simple driver verification tool 2021-05-25 13:04:57 -07:00
.gitignore Enable gradle build caching (#407) 2019-04-22 08:49:54 -07:00
LICENSE Add licenses headers 2013-10-05 21:28:03 -07:00
README.md Switch to GitHub actions (#507) 2020-10-23 19:46:10 -07:00
build.gradle.kts Gradle 6 upgrade (#476) 2020-02-07 09:56:27 -07:00
gradle.properties Update project to Gradle 6.8.3 2021-04-06 17:23:31 -07:00
gradlew Bump some versions to get it to build 2024-05-30 17:22:43 -07:00
gradlew.bat Bump some versions to get it to build 2024-05-30 17:22:43 -07:00
settings.gradle.kts Update project to Gradle 6.8.3 2021-04-06 17:23:31 -07:00

README.md

CI

General

A great place to start is the Website.

For comprehensive documentation see the User Guide

For quick reference, here are some useful details

Dependencies

Gradle
compile "com.impossibl.pgjdbc-ng:pgjdbc-ng:LATEST"
Maven
<dependency>
  <groupId>com.impossibl.pgjdbc-ng</groupId>
  <artifactId>pgjdbc-ng</artifactId>
  <version>LATEST</version>
</dependency>

JDBC URL

The driver accepts basic URLs in the following format

jdbc:pgsql://localhost:5432/db

See the User Guide for complete details on the accepted URL syntax.

Data sources

The javax.sql.DataSource class is

com.impossibl.postgres.jdbc.PGDataSource

, the javax.sql.ConnectionPoolDataSource class is

com.impossibl.postgres.jdbc.PGConnectionPoolDataSource

and the XADataSource class is

com.impossibl.postgres.jdbc.xa.PGXADataSource

License

pgjdbc-ng is released under the 3 clause BSD license.

Building

The driver is built with Gradle. To build & test, execute:

./gradlew clean build.

This will produce, in the driver/build/libs directory, two JAR files. One with dependencies packaged inside (pgjdbg-nc-all-<VERSION>) and another without (pgjdbc-ng-VERSION).

NOTE: Building requires a working install of Docker and Docker Compose as the unit tests are executed against a PostgreSQL instance in a private test container that is automatically started. If you wish to execute the tests against a specific instance of PostgreSQL outside of Docker see Testing.

Alternatively, to build the driver without testing you can execute:

./gradlew clean assemble  

Testing

The unit tests need a PostgreSQL database to execute against. The build will start a Docker container and setup the test environment to execute against that container automatically.

If you don't have Docker installed or, wish to execute the tests against a specific instance of PostgreSQL, you can execute the build or test tasks with the noDocker property set to true. For example:

./gradle -PnoDocker=true test

For this to work the unit tests need to locate your selected PostgreSQL instance. The unit tests attempt a connection assuming theses defaults:

SERVER:     localhost
PORT:       5432
DATABASE:   test
USERNAME:   test
PASSWORD:   test

The following system properties are supported in order to customize the setup

pgjdbc.test.server
pgjdbc.test.port
pgjdbc.test.db
pgjdbc.test.user
pgjdbc.test.password