--- layout: default title: PostgreSQL JDBC Development resource: ../media nav: ../ --- {% include submenu_development.html %}

# Development

- About the Driver
- Tools
- Build Process
- Test Suite

## About the Driver

The PostgreSQL JDBC driver has some unique properties that you should be aware of before starting to develop any code for it. The current development driver supports eleven server versions and three java environments. This doesn't mean that every feature must work in every combination, but a reasonable behaviour must be provided for non-supported versions. While this extra compatibility sounds like a lot of work, the actual goal is to reduce the amount of work by maintaining only one code base.

## Tools

The following tools are required to build and test the driver:

- Java 6 Standard Edition Development Kit At least JDK 1.6
- Apache Maven At least 3.1.1
- Git SCM
- A PostgreSQL instance to run the tests.

## Build Process

After retrieving the source from the git repository. Move into the top level pgjdbc directory and simply type mvn package -DskipTests. This will build the appropriate driver for your current Java version and place it into target/postgresql-${version}.jar.

## Test Suite

To make sure the driver is working as expected there are a set of JUnit tests that should be run. These require a database to run against that has the plpgsql procedural language installed. The default parameters for username and database are "test", and for password it's "test". so a sample interaction to set this up would look the following, if you enter "password" when asked for it:

    postgres@host:~$ createuser -d -A test -P
    Enter password for user "test":
    Enter it again:
    CREATE USER

    postgres@host:~$ createdb -U test test
    CREATE DATABASE

    postgres@host:~$ createlang plpgsql test

Now we're ready to run the tests, we simply type mvn clean package, and it should be off and running. To use non default values to run the regression tests, you can create a build.local.properties in the top level directory. This properties file allows you to set values for host, database, user, password, and port with the standard properties "key = value" usage. The ability to set the port value makes it easy to run the tests against a number of different server versions on the same machine.