Обсуждение: Regarding Error installing jdbc7.0-1.2.jar
hi,
I am using JDK1.2.2. I tried to install postgresql-7.0.3-2.i386.rpm and
its supporting rpms(devel,server,jdbc)
and I succeeded. I am able to open the database using 'psql' and create
tables. Then, I tried to install the jar
file for jdbc 'jdbc7.0-1.2. jar' and extracted it to the directory
/usr/lib/pgsql. Then, I tried to connect database
with jdbc with a sample java program. I gave it like the following way:
try
{
Class.forName("postgresql.Driver");
con=DriverManager.getConnection("jdbc:postgresql://IP
address/","user1","pass1");
}
catch(SQLException se){}
catch(ClassNotFoundException ce){}
.......
......
After compiling successfully, it comes with the following error:
Exception in the thread "main"
java.lang.NoClassDefFoundError : postgresql/Driver (wrong name:
org/postgresql/Driver)
at java.lang.ClassLoader.defineClass0(Native Method)
.......
What could be wrong?
Thanks in advance.
shan.
On Sun, 09 Sep 2001 14:25:38 +0530, you wrote: >Then, I tried to install the jar file for jdbc 'jdbc7.0-1.2. jar' >and extracted it to the directory /usr/lib/pgsql. "Never extract the contents of these jar files!" http://jdbc.postgresql.org/docs/#install Put it in your CLASSPATH instead. 7.0 is pretty old by the way. You may want to get the latest release of the driver from http://jdbc.fastcrypt.com/. But then again, expect some problems when you use the latest release of the driver against a 7.0 backend (7.1 is OK). Regards, René Pijlman <rene@lab.applinet.nl>
I'm not sure if you get this message via the list, but if you post an a mailing list it would be nice if your address worked. ----- Transcript of session follows ----- ... while talking to mail.ceedees.com.: >>> RCPT To:<shan@ceedees.com> <<< 550 <shan@ceedees.com>... Relaying denied 550 <shan@ceedees.com>... User unknown Regards, René Pijlman <rene@lab.applinet.nl>