Filewatcher File Search File Search
Content Search
» » » » » libpg-java_8.2-504-1_all.deb » Content »
pkg://libpg-java_8.2-504-1_all.deb:314060/usr/share/doc/libpg-java/  info  control  downloads

libpg-java - Java database (JDBC) driver for PostgreSQL…  more info»


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 Sun's website:

For problems with this driver, refer to driver's home page:

and associated mailing list:



To compile you will need to have Ant installed. To obtain Ant go to and download the binary. Being pure
java it will run on virtually all java platforms. If you have any problems
please email the 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

If you are having problems, prebuilt versions of the driver 
are available at



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



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 {
	} 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:


   eg: This is an example of running one of my other projects with the driver:

	java -Djdbc.drivers=org.postgresql.Driver

   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:




Also, you can supply both username and passwords as arguments, by appending
them to the URL. eg:



1) If you are connecting to localhost or you can leave it out of the
   URL. ie: jdbc:postgresql://localhost/mydb can be replaced with

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. However, there are some examples included in the example

To run them, they follow the same syntax. For example, the basic example shows
how to insert data, and perform queries:

	java example.basic jdbc:postgresql:test user password

Results 1 - 1 of 1
Help - FTP Sites List - Software Dir.
Search over 15 billion files
© 1997-2017