Problem in connecting with SQL Server 2000
Hi everybody.
I m new 2 this forum. I am a facing a problem while I am trying to connect my Java Application with SQL Server 2000 installed in my system.
I made a JSP in which I wrote the same code as the following codes to connect with SQL Server 2000 database and it is running successfully . At the same machine I am also trying to connect the same database in my simple java application (i.e in main () method ), but it throwing an ClassNotFound exceptio[[ java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver ]]. I installed SQL Server driver SP 1 from MicroSoft's site and also added the path of 3 files in lib directory in the CLASSPATH .
/*******************************************
public class AutoMain {
public static void main(String args[]){
Connection con=null;
try
{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
con=DriverManager.getConnection("jdbc:microsoft:sqlserver://id-10:1433;DatabaseName=myDB;SelectMethod=cursor",username,password);
if ( con != null ){
System.out.println("Connection established");
}
con.close();
}catch( Exception e){
e.printStackTrace();
}
}
********************************************** */
Please help me out .

