Re: setting CLASSPATH of the jdbc jar file

From: "Albe Laurenz" <all(at)adv(dot)magwien(dot)gv(dot)at>
To: "Mamoon Rashid *EXTERN*" <mamoon(at)imtech(dot)res(dot)in>, <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: setting CLASSPATH of the jdbc jar file
Date: 2007-05-25 06:31:58
Message-ID: AFCCBB403D7E7A4581E48F20AF3E5DB202ECA873@EXADV1.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Mamoon Rashid wrote:
>
> i am a newbie using jdbc interface to postgresql.

You are a newbie to UNIX :^)

> Please tell me that at which prompt(either as a root or
> postgres user) i can set CLASSPATH. my jdbc jar file is in
> /usr/share/java/pg74.215.jdbc3.jar. i tried as root as well
> as postgres user and applied following command:

> export CLASSPATH=/usr/share/java/pg74.215.jdbc3.jar:${CLASSPATH}
> After that i looked it with "env" command.it looked well.

> but when i exit and reenturned into root as well as postgres
> user and typed "env" i couldnt see
> "CLASSPATH=/usr/share/java/pg74.215.jdbc3.jar".

The environment variables you set in your shell are lost when
the shell exits, i.e. when you log out.

In order to make your change persistent, you must write it into a
configuration file that is read by your shell at startup.
Assuming that you use bash, that would be .bash_profile in the home
directory of your user (if you want to set the CLASSPATH only for
this user) or /etc/profile if you want the change for all login users.

Yours,
Laurenz Albe

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Mamoon Rashid 2007-05-28 06:17:59 which jdk i should opt for pgsql8.2 to implement jdbc interface
Previous Message Tom Lane 2007-05-24 14:09:56 Re: question about AbstractJdbc2Statement