package com.servlet;
import java.sql.Connection;
import java.sql.DriverManager;
public class Test {
public static void main(String[] srg) {
String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
String dbURL = "jdbc:sqlserver://localhost:201610251855;DatabaseName=QiYe";
String userName = "sa";
String userPwd = "sa";
Connection dbConn = null;
try {
Class.forName(driverName);
dbConn = DriverManager.getConnection(dbURL, userName, userPwd);
System.out.println("Connection Successful!");
} catch (Exception e) {
e.printStackTrace();
}
}
}
rookie2maven
慕的地6079101
rookie2maven
Its_forever
相关分类