I made a simple program in which will connect to ms sql...
then, after running the codes something is error!
can you help me to solve this out...
here is my code:
import java.sql.*;
public class connect_sql {
public static void main(String args[]) {
Connection con = null;
try {
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
con = DriverManager.getConnection( "jdbc:microsoft:sqlserver://localhost:1433","ben","");
if(!con.isClosed())
System.out.println("Successfully connected to MSSQL server...");
}
catch(Exception e)
{
System.err.println("Exception: " + e.getMessage());
}
finally {
try
{
if(con != null)
con.close();
}
catch(SQLException e) {}
}
}
}
and here is the error msg:
Exception: com.microsoft.jdbc.sqlserver.SQLServerDriver
what should I do so that I can connect to sql...
can you pls help me here...
-tnx