My configuration:
- windows XP SP3
- JDBC 2005
- MS SQL Server 2008 Express, exposed via tcp/ip on port 1433
- sqljdbc.jar in class path
I tried:
try {
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver").newInstance();
con = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433/SQLEXPRESS2008;databaseName=Test;selectMethod=cursor", "sa", "");
}
catch (Exception e) {
e.printStackTrace();
}
But it always throws an exception:
java.sql.SQLException: No suitable driver
I also tried the following urls:
localhost:1433/SQLEXPRESS2008
localhost/SQLEXPRESS2008
localhost
Same results. Any help?