ptreves
asked on
Java ClassNotFoundException error
Hello all,
I installed the latest version of a program called Squirrel SQL Client and I am working on a Java program written in version 1.6.0.2. I am working remotely on a Windows XP SP2 client trying to access a remote database. The Squirrel Client can connect to the remote database and I can querry it with no problems. I am not able to do so with java.
My sample code is the following:
Class.forName("net.sourcef orge.jtds. jdbc.Drive r");
conn = DriverManager.getConnectio n
("jdbc:jtds:sqlserver://re s.deeds.ut oronto.ca: 1633", "user48","u48d2007b");
st = conn.createStatement();
I use the following command to run my code
java -cp ..\classes InputUtility48 CustomerList48
I get the error message:
"ClassNotFoundException" : net.sourceforge.jtds.jdbc. Driver
Any help is appreciated,
Regards,
Paolo
I installed the latest version of a program called Squirrel SQL Client and I am working on a Java program written in version 1.6.0.2. I am working remotely on a Windows XP SP2 client trying to access a remote database. The Squirrel Client can connect to the remote database and I can querry it with no problems. I am not able to do so with java.
My sample code is the following:
Class.forName("net.sourcef
conn = DriverManager.getConnectio
("jdbc:jtds:sqlserver://re
st = conn.createStatement();
I use the following command to run my code
java -cp ..\classes InputUtility48 CustomerList48
I get the error message:
"ClassNotFoundException" : net.sourceforge.jtds.jdbc.
Any help is appreciated,
Regards,
Paolo
ASKER
After some editing, here are the values of my CLASSPATH and PATH environment variables:
PATH = %SystemRoot%\system32;%Sys temRoot%;% SystemRoot %\System32 \Wbem;C:\P rogram Files\Java\jdk1.6.0_02\bin ;C:\DEEDS\ jtds-1.2.2 -dist\jtds -1.2.2.jar ;C:\Progra m Files\QuickTime\QTSystem\; C:\Program Files\SQuirrel SQL Client\lib
CLASSPATH = .;C:\DEEDS\jtds-1.2.2-dist \jtds-1.2. 2.jar;C:\P rogram Files\JavaSoft\JRE\1.2\lib \ext\QTJav a.zip
I am still getting the same error message.
Suggestions ?
PATH = %SystemRoot%\system32;%Sys
CLASSPATH = .;C:\DEEDS\jtds-1.2.2-dist
I am still getting the same error message.
Suggestions ?
You need to add jdts driver's jar file (not the dist folder) to the classpath
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks you for your feedback.
After working for some time with Squirrel, all of a sudden, I got the login error:
"res.deeds.utoronto.ca: Login failed for SQL Server login 'user48'. The password for this login has expired."
How can I now resolve this issue ?
Regards,
Paolo
After working for some time with Squirrel, all of a sudden, I got the login error:
"res.deeds.utoronto.ca: Login failed for SQL Server login 'user48'. The password for this login has expired."
How can I now resolve this issue ?
Regards,
Paolo
You dont have another id password?
ASKER
No, unfortunately not.........
Would re-installing Squirrel Client resolve the issue ?
PT
Would re-installing Squirrel Client resolve the issue ?
PT
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
.;C:\Program Files\JavaSoft\JRE\1.2\lib
Note that the "jtds-1.2.2.jar" file is containted in the C:\DEEDS\jtds-1.2.2-dist" folder.
Feedback appreaciated !!!