CLASSPATH (not)

Поиск
Список
Период
Сортировка
Искать

CLASSPATH (not)

От:
jlemcke <jlemcke@netspace.net.au>
Дата:
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.
FAQ