[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Java ClassNotFoundException error

Posted on 2007-10-07
Medium Priority
Last Modified: 2013-11-23
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://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,


Question by:ptreves

Author Comment

ID: 20031009
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 !!!

Author Comment

ID: 20031051
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 ?
LVL 23

Expert Comment

ID: 20032040
You need to add jdts driver's jar file (not the dist folder) to the classpath
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 11

Accepted Solution

Manish earned 1000 total points
ID: 20032423
java -classpath jdbcDriverJar.jar;  ....

Author Comment

ID: 20228070
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 ?


LVL 11

Expert Comment

ID: 20229838
You dont have another id password?

Author Comment

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


Assisted Solution

kunalthakur earned 1000 total points
ID: 21384456
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.

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month19 days, 18 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question