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
ptrevesAsked:
Who is Participating?
 
ManishLeadCommented:
java -classpath jdbcDriverJar.jar;  ....
0
 
ptrevesAuthor Commented:
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 !!!
0
 
ptrevesAuthor Commented:
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 ?
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Ajay-SinghCommented:
You need to add jdts driver's jar file (not the dist folder) to the classpath
0
 
ptrevesAuthor Commented:
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
0
 
ManishLeadCommented:
You dont have another id password?
0
 
ptrevesAuthor Commented:
No, unfortunately not.........
Would re-installing Squirrel Client resolve the issue ?

PT
0
 
kunalthakurCommented:
I dont think installing squirrel client will help as its just a client which connects to your database.
You need to get uname/pwd combination. It has to be setup on the DB server for you to be able to connect to the DB. If you have rights to the DB server you can configure your new uname and pwd otherwise ask your DBA to give u a new uname/pwd combi.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.