Git Product home page Git Product logo

pgjdbc-ng's Introduction

pgjdbc-ng Build Status

A new JDBC driver for PostgreSQL aimed at supporting the advanced features of JDBC and Postgres

http://impossibl.github.io/pgjdbc-ng

Connection format

The connection format for the pgjdbc-ng driver is

jdbc:pgsql://<server>[:<port>]/<database>

An example

jdbc:pgsql://localhost:5432/test

Driver

The java.sql.Driver class is

com.impossibl.postgres.jdbc.PGDriver

The driver will accept configuration parameters in the style of

jdbc:pgsql://localhost:5432/test?applicationName=MyApp&networkTimeout=10000

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

Configuration

The driver and data sources supports the following configuration properties (name, type and default value).

host      (String) localhost

The 'host' parameter specifies the host name of the database server. Data sources only.

port         (int)     5432

The 'port' parameter specifies the port number of the database server. Data sources only.

database     (String)

The 'database' parameter specifies the name of the database on the database server. Data sources only.

user   (String)

The 'user' parameter specifies the user name.

password     (String)

The 'password' parameter specifies the password.

housekeeper      (boolean) true

The 'housekeeper' parameter specifies if the JDBC driver should keep track connections, statements and result sets and automatically close them if they can't no longer be reached.

parsedSqlCacheSize   (int)   250

The 'parsedSqlCacheSize' parameter specifies how big the cache size for parsed SQL statements should be.

preparedStatementCacheSize (int)     50

The 'preparedStatementCacheSize' parameter specifies how big the cache size for PreparedStatement instaces should be.

applicationName          (String)  pgjdbc app

The 'applicationName' parameter specifies the application name associated with the connection on the database server.

clientEncoding          (String)  UTF8

The 'clientEncoding' parameter specifies the client encoding for the database server.

networkTimeout         (int)     0

The 'networkTimeout' parameter specifies the default timeout in milliseconds for the connections. A value of 0 indicates that there isnt a timeout for database operations.

strictMode          (boolean)  false

The 'strictMode' parameter specifies if the JDBC driver should follow behavior assumed by certain frameworks, and test suites. See http://github.com/impossibl/pgjdbc-ng/wiki/StrictMode for additional details.

defaultFetchSize         (int)     0

The 'defaultFetchSize' parameter specifies the default fetch size for statements.

receiveBufferSize         (int)     -1

The 'receiveBufferSize' parameter specifies the size of the receive buffer for the connection.

sendBufferSize         (int)     -1

The 'sendBufferSize' parameter specifies the size of the send buffer for the connection.

sslMode          (String)

The 'sslMode' parameter specifies which SSL mode that should be used to connect to the database server. Valid values include 'prefer', 'require', 'verify-ca' and 'verify-full'.

sslPassword          (String)

The 'sslPassword' parameter specifies the SSL password.

sslCertificateFile          (String)

The 'sslCertificateFile' parameter specifies the SSL certificate file as a path.

sslKeyFile          (String)

The 'sslKeyFile' parameter specifies the SSL key file as a path.

sslRootCertificateFile          (String)

The 'sslRootCertificateFile' parameter specifies the SSL root certificate file as a path.

License

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

Building

The driver is built with maven. Simply build with:

mvn clean package

This will produce, in the target directory, two JAR files. One with dependencies packaged inside and another without.

Testing

The unit tests need a PostgreSQL database to execute against. The tests assume theses defaults:

SERVER:     localhost
PORT:       5432
DATABASE:   test
USERNAME:   pgjdbc
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

If you'd like to build the driver without running the unit tests use the command:

mvn clean package -DskipTests

pgjdbc-ng's People

Contributors

kdubb avatar jesperpedersen avatar brettwooldridge avatar gsmet avatar georgekankava avatar brentavery avatar dstipp avatar frode-carlsen avatar yrashk avatar oscerd avatar davsclaus avatar brcolow avatar pkolaric avatar roelvr avatar mishako avatar

Watchers

Chakra avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.