CLASSPATH (not)

From: jlemcke <jlemcke(at)netspace(dot)net(dot)au>
To: jdbc postgresql <pgsql-jdbc(at)postgresql(dot)org>
Subject: CLASSPATH (not)
Date: 2001-04-01 06:15:07
Message-ID: 3AC6C76B.EAE96FDF@netspace.net.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi all,

I've noticed quite a few postings lately about connecting to the jdbc driver. They all seem to mention having the CLASSPATH environment variable set correctly.
In a lot of cases setting CLASSPATH is unnecessary.
Java 1.2 introduced a feature called the Extension Mechanism which basically allows you to make a package accessible by placing its .jar file in a special Java runtime directory.
All you need to do is copy (or link) your postgresql.jar (or your particular version of it) to the path_to_jre/lib/ext directory; path_to_jre on my Java installation is /usr/java/jdk1.3/jre .
To quote Sun's documentation :

> Any set of packages or classes can easily be made to play the role
> of an extension. The first step in turning a set of classes into
> an extension is to bundle them in a JAR file. Once that's done, you
> can turn the software into an extension in two ways:
>
> * by placing the JAR file in a special location in the directory
> structure of the Java Runtime Environment, in which case it's
> called an installed extension.
> * by referencing the JAR file in a specified way from the manifest
> of the another JAR file, in which case it's called a download
> extension.

Check out Sun's Java Tutorial page at :
http://java.sun.com/docs/books/tutorial/ext/index.html
or their documentation at
http://java.sun.com/products/jdk/1.2/docs/guide/extensions/

Have Fun,

John L.

Browse pgsql-jdbc by date

  From Date Subject
Next Message Peter T Mount 2001-04-02 13:12:22 Re: [JDBC] Logging Queries
Previous Message Corinne Rhodes 2001-03-31 19:36:36 CallableStatement Implementation