I am trying to connect to SQL SERVER 2008 using a JDBC connection. I have read some older posts on this topic(SQL server 2000, SQL server 2005) and I feel there may be some minor variations and so am posting on this forum.
I am running win XP with SP 3.
I have downloaded MS Sqlserver JDBC driver 3.0 and appended the following CLASSPATH on command prompt
c:>set CLASSPATH= C:\Program Files\Microsoft SQL Server JDBC Driver 3.0\sqljdbc_3.0\enu\sqljdbc4.jar.
(The path and the spelling is correct).
When SQL server 2008 is up and running, I am using the following program to test a connection to the database
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.DriverManager;
import java.lang.*;
class TestDB
{
public static void main (String [] args)
{
try
{
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
}
catch(ClassNotFoundException cnfe)
{
System.out.println(cnfe);
}
}
}
It compiles fine but throws a run time exception as java.lang.classNoFfoundException.
Can somebody pls help me trouble shoot.
Thanks
Raghu