http://bbs.csdn.net/topics/392187993
你sql server 什么版本的
driver="com.microsoft.jdbc.sqlserver.SQLServerDriver";
这个语句跟版本有关系有的jdbc在前面,有的就是sqlserver在前面。
com.microsoft.jdbc.sqlserver.SQLServerDriver
com.microsoft.sqlserver.jdbc.SQLServerDriver
剩下可以参考
http://www.cnblogs.com/rookiebob/p/3749396.html
报什么错?另外驱动包放一个就行了
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
String connectionUrl = "jdbc:sqlserver://localhost:1433;" +
"databaseName=student;user=sa;password=123;";
Connection con = DriverManager.getConnection(connectionUrl);
Statement st=con.createStatement();