Java ClassNotFoundException error

Posted on 2007-10-07
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://",  "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

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

    Author Comment

    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 ?
    LVL 23

    Expert Comment

    You need to add jdts driver's jar file (not the dist folder) to the classpath
    LVL 11

    Accepted Solution

    java -classpath jdbcDriverJar.jar;  ....

    Author Comment

    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 ?


    LVL 11

    Expert Comment

    You dont have another id password?

    Author Comment

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

    LVL 1

    Assisted Solution

    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

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
    Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
    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…
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    728 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now