pax_global_header 0000666 0000000 0000000 00000000064 12050675701 0014515 g ustar 00root root 0000000 0000000 52 comment=f9c2e98d9c80abb2b04690c8bc0c16f11a797c79
postgresql-jdbc-9.2-1002.src/ 0000775 0000000 0000000 00000000000 12050675701 0015640 5 ustar 00root root 0000000 0000000 postgresql-jdbc-9.2-1002.src/.gitignore 0000664 0000000 0000000 00000000074 12050675701 0017631 0 ustar 00root root 0000000 0000000 .classpath
.project
.externalToolBuilders
build
jars
.*.swp
postgresql-jdbc-9.2-1002.src/LICENSE 0000664 0000000 0000000 00000003006 12050675701 0016644 0 ustar 00root root 0000000 0000000 Copyright (c) 1997-2011, PostgreSQL Global Development Group
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the PostgreSQL Global Development Group nor the names
of its contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
postgresql-jdbc-9.2-1002.src/META-INF/ 0000775 0000000 0000000 00000000000 12050675701 0017000 5 ustar 00root root 0000000 0000000 postgresql-jdbc-9.2-1002.src/META-INF/services/ 0000775 0000000 0000000 00000000000 12050675701 0020623 5 ustar 00root root 0000000 0000000 postgresql-jdbc-9.2-1002.src/META-INF/services/java.sql.Driver 0000664 0000000 0000000 00000000026 12050675701 0023515 0 ustar 00root root 0000000 0000000 org.postgresql.Driver
postgresql-jdbc-9.2-1002.src/README 0000664 0000000 0000000 00000015340 12050675701 0016523 0 ustar 00root root 0000000 0000000 This is a simple readme describing how to compile and use the jdbc driver.
---------------------------------------------------------------------------
This isn't a guide on how to use JDBC - for that refer to Oracle's website:
http://www.oracle.com/technetwork/java/javase/jdbc/
and the JDBC tutorial:
http://docs.oracle.com/javase/tutorial/jdbc/
For problems with this driver, refer to driver's home page:
http://jdbc.postgresql.org/
and associated mailing list:
http://archives.postgresql.org/pgsql-jdbc/
---------------------------------------------------------------------------
COMPILING
To compile you will need to have a Java 5 or newer JDK and will need to have
Ant installed. To obtain Ant go to http://ant.apache.org/index.html and
download the binary. Being pure Java it will run on virtually all Java
platforms. If you have any problems please email the pgsql-jdbc list.
Once you have Ant, simply run ant in the top level directory. This will
compile the correct driver for your JVM, and build a .jar file (Java ARchive)
called postgresql.jar.
REMEMBER: Once you have compiled the driver, it will work on ALL platforms
that support that version of the API. You don't need to build it for each
platform.
If you are having problems, prebuilt versions of the driver
are available at http://jdbc.postgresql.org/
---------------------------------------------------------------------------
INSTALLING THE DRIVER
To install the driver, the postgresql.jar file has to be in the classpath.
ie: under LINUX/SOLARIS (the example here is my linux box):
export CLASSPATH=.:/usr/local/pgsql/share/java/postgresql.jar
---------------------------------------------------------------------------
USING THE DRIVER
To use the driver, you must introduce it to JDBC. Again, there's two ways
of doing this:
1: Hardcoded.
This method hardcodes your driver into your application/applet. You
introduce the driver using the following snippet of code:
try {
Class.forName("org.postgresql.Driver");
} catch(Exception e) {
// your error handling code goes here
}
Remember, this method restricts your code to just the postgresql database.
However, this is how most people load the driver.
2: Parameters
This method specifies the driver from the command line. When running the
application, you specify the driver using the option:
-Djdbc.drivers=org.postgresql.Driver
eg: This is an example of running one of my other projects with the driver:
java -Djdbc.drivers=org.postgresql.Driver uk.org.retep.finder.Main
note: This method only works with Applications (not for Applets).
However, the application is not tied to one driver, so if you needed
to switch databases (why I don't know ;-) ), you don't need to
recompile the application (as long as you havent hardcoded the url's).
---------------------------------------------------------------------------
JDBC URL syntax
The driver recognises JDBC URL's of the form:
jdbc:postgresql:database
jdbc:postgresql://host/database
jdbc:postgresql://host:port/database
Also, you can supply both username and passwords as arguments, by appending
them to the URL. eg:
jdbc:postgresql:database?user=me
jdbc:postgresql:database?user=me&password=mypass
Notes:
1) If you are connecting to localhost or 127.0.0.1 you can leave it out of the
URL. ie: jdbc:postgresql://localhost/mydb can be replaced with
jdbc:postgresql:mydb
2) The port defaults to 5432 if it's left out.
---------------------------------------------------------------------------
That's the basics related to this driver. You'll need to read the JDBC Docs
on how to use it.
---------------------------------------------------------------------------
BUG REPORTS, PATCHES AND DEVELOPMENT
PgJDBC development is carried out on the PgJDBC mailing list:
http://jdbc.postgresql.org/lists.html
and on GitHub:
https://github.com/pgjdbc/pgjdbc
Bug reports
-----------
For bug reports please post on pgsql-jdbc or add a GitHub issue. If you include
additional unit tests demonstrating the issue, or self-contained runnable test
case including SQL scripts etc that shows the problem, your report is likely to
get more attention. Make sure you include appropriate details on your
environment, like your JDK version, container/appserver if any, platform,
PostgreSQL version, etc. Err on the site of excess detail if in doubt.
Bug fixes and new features
--------------------------
If you've developed a patch you want to propose for inclusion in PgJDBC, feel
free to send a GitHub pull request or post the patch on the PgJDBC mailing
list. Make sure your patch includes additional unit tests demonstrating and
testing any new features. In the case of bug fixes, where possible include a
new unit test that failed before the fix and passes after it.
For information on working with GitHub, see:
http://help.github.com/articles/fork-a-repo
http://learn.github.com/p/intro.html
Testing
-------
Remember to test proposed PgJDBC patches when running against older PostgreSQL
versions where possible, not just against the PostgreSQL you use yourself.
You also need to test your changes with older JDKs. PgJDBC must support JDK5
("Java 1.5") and newer, which means you can't use annotations, auto-boxing, for
(:), and numerous other features added since JDK 5. Code that's JDBC4 specific
may use JDK6 features, and code that's JDBC4.1 specific may use JDK7 features.
Common code and JDBC3 code needs to stick to Java 1.5.
Two different versions of PgJDBC can be built, the JDBC 3 and JDBC 4 drivers.
The former may be built with JDK 5, while building JDBC4 requires JDK 6 or 7.
The driver to build is auto-selected based on the JDK version used to run the
build. The best way to test a proposed change with both the JDBC3 and JDBC4
drivers is to build and test with both JDK5 and JDK6 or 7.
You can get old JDK versions from the Oracle Java Archive:
http://www.oracle.com/technetwork/java/archive-139210.html
Typically you can test against an old JDK with:
export JAVA_HOME=/path/to/jdk_1_5
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:
ant clean test
For information about the unit tests and how to run them, see
org/postgresql/test/README
Ideas
-----
If you have ideas or proposed changes, please post on the mailing list.
Think about how the change would affect other users, what side effects it
might have, how practical it is to implement, what implications it would
have for standards compliance and security, etc.
Few of the PgJDBC developers have much spare time, so it's unlikely that your
idea will be picked up and implemented for you. The best way to make sure a
desired feature or improvement happens is to implement it yourself. The PgJDBC
sources are reasonably clear and they're pure Java, so it's sometimes easier
than you might expect.
postgresql-jdbc-9.2-1002.src/build.properties 0000664 0000000 0000000 00000000266 12050675701 0021061 0 ustar 00root root 0000000 0000000 # Default build parameters. These may be overridden by local configuration
# settings in build.local.properties.
#
major=9
minor=2
fullversion=9.2
def_pgport=5432
enable_debug=yes
postgresql-jdbc-9.2-1002.src/build.xml 0000664 0000000 0000000 00000054737 12050675701 0017501 0 ustar 00root root 0000000 0000000
]>
postgresql-jdbc-9.2-1002.src/certdir/ 0000775 0000000 0000000 00000000000 12050675701 0017274 5 ustar 00root root 0000000 0000000 postgresql-jdbc-9.2-1002.src/certdir/README 0000664 0000000 0000000 00000004663 12050675701 0020165 0 ustar 00root root 0000000 0000000
To run the SSL tests, the following properties are used:
certdir: directory where the certificates and keys are store
ssl<8|9>: a connection string to the appropiate database
TYPE is the TYPE or METHOD field from pg_hba.conf that is: host, hostnossl,
hostssl and the special types hostsslcert, that corresponds
to a hostssl type with clientcert=1 and cert that corresponds
to a hostssl type with cert authentication. 'gh' means, the server certificate
matches the hostname (good hostname), 'bh' means it is not (bad
hostname). It can be simulated with a single database, if two names
can be used i.e. localhost and 127.0.0.1. ssloff points to a database,
where ssl is off. The last number is the server major version
For each connection, the following files should be placed into certdir:
goodclient.crt, badclient.crt, goodclient.pk8, badclient.pk8, goodroot.crt, badroot.crt
optionally prefixed by the value of sslprefix property, if
different files are necessary for different connect strings.
This directory contains example certificates generated by the following
commands:
openssl req -x509 -newkey rsa:1024 -days 3650 -keyout goodclient.key -out goodclient.crt
#Common name is test, password is sslpwd
openssl req -x509 -newkey rsa:1024 -days 3650 -keyout badclient.key -out badclient.crt
#Common name is test, password is sslpwd
openssl req -x509 -newkey rsa:1024 -days 3650 -nodes -keyout badroot.key -out badroot.crt
#Common name is localhost
rm badroot.key
openssl pkcs8 -topk8 -in goodclient.key -out goodclient.pk8 -outform DER -v1 PBE-MD5-DES
openssl pkcs8 -topk8 -in badclient.key -out badclient.pk8 -outform DER -v1 PBE-MD5-DES
cp goodclient.crt server/root.crt
cd server
openssl req -x509 -newkey rsa:1024 -nodes -days 3650 -keyout server.key -out server.crt
cp server.crt ../goodroot.crt
#Common name is localhost, no password
The subdirectory server contains what should be copied to the PGDATA directory.
If you do not overwrite the pg_hba.conf then remember to comment out all lines
starting with "host all".
For the tests the sslinfo module must be installed into every database.
The ssl=on must be set in postgresql.conf
The following command creates the databases and installs the sslinfo module.
for db in hostssldb hostnossldb certdb hostsslcertdb; do
createdb $db
psql $db -c "create extension sslinfo"
done
The username for connecting to postgres as specified in build.local.properties tests has to be "test".
postgresql-jdbc-9.2-1002.src/certdir/badclient.crt 0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tmvrX3D1yd
-----END CERTIFICATE-----
postgresql-jdbc-9.2-1002.src/certdir/badclient.key 0000664 0000000 0000000 00000001703 12050675701 0021734 0 ustar 00root root 0000000 0000000 -----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,95718EE22B89E019
78LEg7uq4krPR3C1sQVCiQsPIXroyoDzPHBFmI+ipEJq7obFACK9KROfUAaMlca8
ZR1UhtQHCPK4TOG1qKjn8lxeKGLZA25Lcilw6QvZCfNyBa6JUp3cdwzUSv7/qE/Y
d/wlVAq71JbOmYsbEwunZlq+DO1AaL91N/2ANgSSC85uR0dye0iZ1C0OZzawMXkd
wXRrXb8c8RCH2gQ6V4aMartTZ/DQznA59+NEUYln5IMP4joRM0TTpcuv6oCq1UUw
o7xEQcwfBB0tKayxkBfgp8Jvrghzw0usSFt4ad9I4DF/V2izojZgYsnT7yGqsop6
7jmPR9llYhDQIZd0V4NZziiRF2Dt/lyG0iUPZq5vlhLaI59FzMAxVSAJP6DrUHQD
L76TeGpQm2LRqWliDc+3AMTCKv0TP1IPbIWJrnLxnNf/C29adO+VSeQEQ0+tBU+/
DE2GVsQ/xul+QyCwXiOce0pfERLuGjSu/kRa1ylAlrdH4+6vBD0ewuXXHv0eTSxB
Vi0vde5a9PzPUMUBkg6PS7IDYJmKm04fFPxx3y8GMlzbZYOYjTepkYMbayekybGK
fHVk9Z3lW5yzegaz8iJu/8le6Kn4Ox21FRG45domu1T+8eJuXPoiBUb290SUVuxh
VTQWhCA8ElmVCYfrbSnYL3naeqVL+Oc6by3VVhvgiqUuXQTZvKN7mkUOhiNbpz2H
iGLwlRj6wXEaS0qLb9NQc9H9Vv6ftj7UPa4FkiJjWhUW0WkA5sqtOKMjLzpsIZtR
dFb26NE65tk0lrywQrzMBFM6fk90VrMYyvwukZIJIKRLCBQaG24PLQ==
-----END RSA PRIVATE KEY-----
postgresql-jdbc-9.2-1002.src/certdir/badclient.pk8 0000664 0000000 0000000 00000001245 12050675701 0021647 0 ustar 00root root 0000000 0000000 00 *H
0g Uks~sR+adV^]r4RBg3&S45IT\.X[I_
ǀ
$yPӐ<CR0u)B]]ԜQ;5u$8ݩ=nkbE&EԻ>!&
Petǔor4Rk&Ih^P&x/K
s\#dqnNݴA
(w;4Qaxޣch <D}<4.~6־7sQZrfDzxVԦYu&KSG)IL Eڳn@D~,^%
elfHL
۹lc-&jt[Cp]"bG*%ޞ%E@ńa)