postgresql-jdbc.git / summary / log / commit / refs

commit    5801e321e90e06a66020bd015b9e43550ffdf7cd
Author:   Dave Cramer <davecramer@gmail.com>
Commit:   GitHub <noreply@github.com>
Date:     Thu Aug 06 12:40:05 2020 +0000

    update docs into the next century (#1770)
    
    * update docs into the next century
    
    * fix grammar for prepare
    
    * update to gradle


docs/documentation/head/classpath.md | 13 ++++++++----- docs/documentation/head/prepare.md | 9 +++------ docs/documentation/head/setup.md | 28 +++++++++++++++------------- 3 files changed, 26 insertions(+), 24 deletions(-) diff --git a/docs/documentation/head/classpath.md b/docs/documentation/head/classpath.md index 88f55679..949d3cbd 100644 --- a/docs/documentation/head/classpath.md +++ b/docs/documentation/head/classpath.md @@ -9,20 +9,23 @@ nexttitle: Preparing the Database Server for JDBC next: prepare.html --- -To use the driver, the JAR archive named `postgresql.jar` if you built from source, -otherwise it will likely be (named with the following convention: `postgresql-*[server version]*.*[build number]*.jdbc*[JDBC version]*.jar`, -for example `postgresql-8.0-310.jdbc3.jar`) needs to be included in the class path, +To use the driver, the JAR archive named `postgresql-MM.nn.pp.jar` needs to be included in the class path, either by putting it in the `CLASSPATH` environment variable, or by using flags on the **java** command line. For instance, assume we have an application that uses the JDBC driver to access a database, and that application is installed as `/usr/local/lib/myapp.jar`. The -PostgreSQL™ JDBC driver installed as `/usr/local/pgsql/share/java/postgresql.jar`. +PostgreSQL™ JDBC driver installed as `/usr/local/pgsql/share/java/postgresql-MM.nn.pp.jar`. To run the application, we would use: ```bash -export CLASSPATH=/usr/local/lib/myapp.jar:/usr/local/pgsql/share/java/postgresql.jar:. +export CLASSPATH=/usr/local/lib/myapp.jar:/usr/local/pgsql/share/java/postgresql-42.2.15.jar:. java MyApp ``` +Current Java applications will likely use maven, gradle or some other package manager. +[Use this to search](https://mvnrepository.com/artifact/org.postgresql/postgresql) for the +latest jars and how to include them in your project + + Loading the driver from within the application is covered in [Chapter 3, Initializing the Driver](use.html). diff --git a/docs/documentation/head/prepare.md b/docs/documentation/head/prepare.md index b7b55991..a80b73fd 100644 --- a/docs/documentation/head/prepare.md +++ b/docs/documentation/head/prepare.md @@ -9,17 +9,14 @@ nexttitle: Creating a Database next: your-database.html --- -Because Java does not support using unix sockets the PostgreSQL™ server must be +Out of the box, Java does not support unix sockets so the PostgreSQL server must be configured to allow TCP/IP connections. Starting with server version 8.0 TCP/IP connections are allowed from `localhost`. To allow connections to other interfaces than the loopback interface, you must modify the `postgresql.conf` file's `listen_addresses` setting. -For server versions prior to 8.0 the server does not listen on any interface by -default, and you must set `tcpip_socket = true` in the `postgresql.conf` file. Once you have made sure the server is correctly listening for TCP/IP connections the next step is to verify that users are allowed to connect to the server. Client -authentication is setup in `pg_hba.conf`. Refer to the main PostgreSQL™ documentation -for details. The JDBC driver supports the `trust`, `ident`, `password`, `md5`, `gss` and -`crypt` authentication methods. +authentication is setup in `pg_hba.conf`. Refer to the main PostgreSQL™ [documentation](https://www.postgresql.org/docs/current/auth-pg-hba-conf.html) +for details . diff --git a/docs/documentation/head/setup.md b/docs/documentation/head/setup.md index 46686606..2461ac97 100644 --- a/docs/documentation/head/setup.md +++ b/docs/documentation/head/setup.md @@ -22,23 +22,25 @@ programs that use the JDBC interface. <a name="build"></a> # Getting the Driver -Precompiled versions of the driver can be downloaded from the [PostgreSQL™ JDBC web site](http://jdbc.postgresql.org). +Precompiled versions of the driver can be downloaded from the [PostgreSQL™ JDBC web site](https://jdbc.postgresql.org). Alternatively you can build the driver from source, but you should only need to do this if you are making changes to the source code. To build the JDBC driver, -you need Ant 1.5 or higher and a JDK. Ant is a special tool for building Java-based -packages. It can be downloaded from the [Ant web site](http://ant.apache.org/index.html). +you need gradle and a JDK (currently at least jdk1.8) . -If you have several Java compilers installed, it depends on the Ant configuration -which one gets used. Precompiled Ant distributions are typically set up to read -a file `.antrc` in the current user's home directory for configuration. For example, +If you have several Java compilers installed, maven will use the first one on the path. +To use a different one set JAVA_HOME to the Java version you wish to use For example, to use a different JDK than the default, this may work: -`JAVA_HOME=/usr/local/jdk1.6.0_07` -`JAVACMD=$JAVA_HOME/bin/java` +`JAVA_HOME=/usr/local/jdk1.8.0_45` -To compile the driver simply run **ant** in the top level directory. The compiled -driver will be placed in `jars/postgresql.jar`. The resulting driver will be built -for the version of Java you are running. If you build with a 1.4 or 1.5 JDK you -will build a version that supports the JDBC 3 specification and if you build with -a 1.6 or higher JDK you will build a version that supports the JDBC 4 specification. \ No newline at end of file +To compile the driver simply run **gradlew assemble** or **gradlew build** if you want to run the tests +in the top level directory. +Note: if you want to skip test execution, add the option -DskipTests. +This will build 3 versions of the driver; pgjdbc, pgjdbc-jre7, and pgjdbc-jre6 +The compiled driver will be placed in `pgjdbc/build/libs/postgresql-MM.nn.pp.jar`, +`pgjdbc-jre7/build/libs/postgresql-MM.nn.pp.jar` and `pgjdbc-jre7/build/libs/postgresql-MM.nn.pp.jar` +Where MM is the major version, nn is the minor version and pp is the patch version. +Versions for JDBC3 and lower can be found [here](https://jdbc.postgresql.org/download.html#others) +This is a very brief outline of how to build the driver. Much more detailed information can be +found on the [github repo](https://github.com/pgjdbc/pgjdbc/blob/master/CONTRIBUTING.md) [parent: 148ecb589b6f]