class DB {
private static SqlConnection conn;
public static SqlConnection getConn() {
//conn = new SqlConnection("server=localhost;database=import;uid=sa;pwd=123");//第一种用户名密码方式
conn = new SqlConnection("Data Source= localhost;Integrated Security=SSPI;Initial Catalog=import");//第二种windows身份验证
return conn;
}
}