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 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:

        conn = DriverManager.getConnection
                    ("jdbc:jtds:sqlserver://",  "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,


Who is Participating?
java -classpath jdbcDriverJar.jar;  ....
ptrevesAuthor Commented:
This is the value of my CLASSPATH variable:

.;C:\Program Files\JavaSoft\JRE\1.2\lib\ext\;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 !!!
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\

I am still getting the same error message.
Suggestions ?
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.

You need to add jdts driver's jar file (not the dist folder) to the classpath
ptrevesAuthor Commented:
Thanks you for your feedback.
After working for some time with Squirrel, all of a sudden, I got the login error:

" Login failed for SQL Server login 'user48'. The password for this login has expired."

How can I now resolve this issue ?


You dont have another id password?
ptrevesAuthor Commented:
No, unfortunately not.........
Would re-installing Squirrel Client resolve the issue ?

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.
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.