连接SQLServer:
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
connection =DriverManager.getConnection("jdbc:sqlserver://127.0.0.1:1433", "dd","dw");
jdbc好似不能以windows身份验证模式连接sqlserver数据库!
连接Oracle:
Class.forName("oracle.jdbc.driver.OracleDriver");
String urlString = "jdbc:oracle:thin:@localhost:1521:ORCL";Connection connection = DriverManager.getConnection(urlString,"newuser", "new123");
//加载MySQL Driver
CLass.forName("com.mysql.jdbc.Driver");
//注册MySQL Driver
java.sql.DriverManager.registerDriver....