javajdbcjtds

ClassNotFoundException: net.sourceforge.jtds.jdbc.Driver


I have java code which connects to a MS-SQL database and procures some data.

Before running the code I set the class path in the Unix Server and it used to work fine.

But for some reason the same jar file which was working a few days back is throwing a Class not found exception java.lang.ClassNotFoundException: net.sourceforge.jtds.jdbc.Driver

I have un-jared the jar file and found that the driver class which I'm loading :

Class.forName("net.sourceforge.jtds.jdbc.Driver");

is present in the specified package structure.

I don't understand how this is happening.

Can anyone suggest any tips to resolve this.


Solution

  • The issue of java.lang.ClassNotFoundException might be the outcome of several reasons:

    Please verify the last three options.