展开全部
Class.forName(
"com.microsoft.sqlserver.jdbc.SQLServerDriver")
.newInstance();
String url = "jdbc:sqlserver://IP:1433;databaseName=数据库名";
Connection conn = DriverManager.getConnection(url, "登陆用户名",
"登陆密码");
Statement stmt = conn.createStatement(
ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
String sql = "select * from t_userdb where gh='" + yh + "'"
+ "and jgbm='" + mm + "'";
//out.println(sql);
ResultSet rs = stmt.executeQuery(sql);
"com.microsoft.sqlserver.jdbc.SQLServerDriver")
.newInstance();
String url = "jdbc:sqlserver://IP:1433;databaseName=数据库名";
Connection conn = DriverManager.getConnection(url, "登陆用户名",
"登陆密码");
Statement stmt = conn.createStatement(
ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
String sql = "select * from t_userdb where gh='" + yh + "'"
+ "and jgbm='" + mm + "'";
//out.println(sql);
ResultSet rs = stmt.executeQuery(sql);
追问
这不是基本的jdbc嘛,而且也不是java。。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询