Re: Where and What To Do for JDBC

From: John R Pierce <pierce(at)hogranch(dot)com>
To: ray <Ray(dot)Joseph(at)CDICorp(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Where and What To Do for JDBC
Date: 2009-03-30 02:15:38
Message-ID: 49D02B4A.7000802@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

ray wrote:
> I am installing PostgreSQL 8.3. I chose to include JDBC. During the
> installation, this message was included:
> JDBC
> The JDBC drivers are installed into the jdbc\ subdirectory of the main
> installation directory by default. You may wish to add this folder to
> the CLASSPATH environment variable to allow the drivers to be found
> automatically by your Java programs.
>
> I would like to put the location in my classpath. But I do not know
> which path the message is relating to; I have several jdbc paths
> around the postgresql path due to many attempts at installation.
>
> What is meant by "main installation directory"? So I may better
> identify the correct folder, what subfolders might the correct JDBC
> folder have?
>

you're looking for postgresql-jdbc-xxxxxxxx.jar

I find you generally need to name the file in the classpath. for
instance, for postgres 8.3 and java 1.5, I use...

export CLASSPATH=$CLASSPATH:/path/to/postgresql-8.3-604.jdbc3.jar

and then on my java command lines...

java -classpath $CLASSPATH ......

where the .... is the rest of what would otherwise be there.

if you're on MS Windows,, replace `export` with SET, and the $ with %
(and use two %% if its in a .bat file)...oh, and probably a ; insteadd
of a : in the set CLASSPATH= thing...

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Eric Smith 2009-03-30 02:55:07 Re: running two servers on one machine
Previous Message Tom Lane 2009-03-30 02:10:56 Re: [Q] LOG: failed to commit client_encoding