Link to home
Create AccountLog in
Avatar of ptreves
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.sourceforge.jtds.jdbc.Driver");
        conn = DriverManager.getConnection
                    ("jdbc:jtds:sqlserver://res.deeds.utoronto.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
Avatar of ptreves
ptreves

ASKER

This is the value of my CLASSPATH variable:

.;C:\Program Files\JavaSoft\JRE\1.2\lib\ext\QTJava.zip;C:\DEEDS\jtds-1.2.2-dist;C:\Program Files\SQuirrel SQL Client\lib

Note that the "jtds-1.2.2.jar" file is containted in the C:\DEEDS\jtds-1.2.2-dist" folder.

Feedback appreaciated !!!
Avatar of ptreves

ASKER

After some editing, here are the values of my CLASSPATH and PATH environment variables:

PATH = %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Java\jdk1.6.0_02\bin;C:\DEEDS\jtds-1.2.2-dist\jtds-1.2.2.jar;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\SQuirrel SQL Client\lib

CLASSPATH = .;C:\DEEDS\jtds-1.2.2-dist\jtds-1.2.2.jar;C:\Program Files\JavaSoft\JRE\1.2\lib\ext\QTJava.zip

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
Avatar of Manish
Manish
Flag of India image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of ptreves

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
You dont have another id password?
Avatar of ptreves

ASKER

No, unfortunately not.........
Would re-installing Squirrel Client resolve the issue ?

PT
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account