[java]代码库
protected static String JDBCDriver = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
protected static String jdburl = "jdbc:sqlserver://localhost:1433;DatabaseName=db_database28";
protected static String dbUser = "";
protected static String dbPwd = "";
try {
if (conn == null) {
Class.forName(driverName);
conn= DriverManager.getConnection(url,dbuser,pwd);
}
System.out.println("JDBC加载成功!");
}catch(SQLException sqlException)
{
sqlException.printStackTrace();
}catch(Exception ex){
ex.printStackTrace();
System.out.println(ex);
}
初级程序员
by: 云代码会员 发表于:2016-10-16 00:02:02 顶(0) | 踩(0) 回复
可以
回复评论