CLASSPATH Problem ????

From: Kostas Stergiou <k99st(at)yahoo(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: CLASSPATH Problem ????
Date: 2004-02-29 19:35:56
Message-ID: 20040229193556.52481.qmail@web20202.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

For the last two days i'm trying to use java on a
linux box but i'm completely lost i'm afraid.
What i want to do is to write an app that will
communicate with a database (oracle or postgres).
I use Suse 9 and postgresql to start.
The database is configured without problems and i can
communicate with it using psql utility (the owner of
the postgres is another user i created also named
postgres).
I can communicate with the db also through C / C++
with no problems.
To use java i download the pg73jdbc3.jar (postgres
version is 7.3.4). I copied that file in /usr/lib/java
and i tried to compile the following program

import java.sql.*;

class JDBCVersion
{
public static void main (String args[])
throws SQLException
{
Class.forName("org.postgresql.Driver");
}

The response i got was
unreported exception java.lang.ClassNotFoundException

Trying to resolve that error i've found that there
were no CLASSPATH variable for any user. I added the
line
export
CLASSPATH=/usr/lib/java:/usr/lib/java/pg73jdbc3.jar
in .bash file but that didn't help.
Other vars like JAVA_HOME, JAVA_JDK was already set by
the OS.
Since i'm new in java and linux i tried jbuilderX from
borland in case i could manage it better through IDE.
In jbuilder i added a library through
Tools->Configure Libraries->New->Class->pg73jdbc3.jar
I also added in the class option of
Tools->Configure JDK->User Home
the line
/home/usr/JBuilderX/thirdparty/postgres/pg73jdbc3.jar
and in project properties option i added the jar file
in required libraries
That didn't seem to work also. The same program
doesn't work in the IDE. When i'm trying to use
Database Pilot the postgres driver is always
displaying in red.
I tried the same with oracle 9i and still nothing
works.
Everything seem to work ok in windows 2k installation.
What am i doing wrong in Suse? Is it a CLASSPATH
problem as i believe or it might be something else?

Sorry for the size of the post, but i'm completely
confused

PS i tried another version of the driver
(pg74.1.jdbc3.jar) with the same results

TIA

__________________________________
Do you Yahoo!?
Get better spam protection with Yahoo! Mail.
http://antispam.yahoo.com/tools

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Bruce Ashton 2004-02-29 19:57:09 Re: CLASSPATH Problem ????
Previous Message Marc G. Fournier 2004-02-29 02:11:49 Re: Where has the source code moved to?