日期:2014-05-20 浏览次数:20822 次
package cn.baidu.ch03; import java.sql.DriverManager; import java.sql.Connection; public class Test { public static void main(String[] args){ Connection conn = null; try { Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); conn = DriverManager.getConnection("jdbc:sqlserver://localhost:1433;databaseName=HOUSE","sa","123"); System.out.println("成功"); } catch (Exception e) { e.printStackTrace(); } } }