public class JavaApplication2 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
try {
Class.forName("com.microsoft.sqlserver.jdbc.SQLSer verDriver");
String connectionUrl = "jdbc:sqlserver://localhost:1433;databaseName=Attendance;user=suhail ;password=123456";
Connection con = DriverManager.getConnection(connectionUrl);
// String connectionUrl = "jdbc:sqlserver://localhost;integratedSecurity=true";
// Connection con = DriverManager.getConnection(connectionUrl);
} catch (SQLException e) {
System.out.println("SQL Exception: " + e.toString());
} catch (ClassNotFoundException cE) {
System.out.println("Class Not Found Exception: " + cE.toString());
}
}
}
This is the snipped code....I am getting error as "connection refuses" what is the error in the code plz help me
thanks