62,623
社区成员
发帖
与我相关
我的任务
分享
try{
Class.forName(driver);
System.out.println("driver is ok");
con = DriverManager.getConnection(url,"sa","");
System.out.println("conection is ok");
sta = con.createStatement();
//String sql = "";
rs = sta.executeQuery("select code from userbiao where user ='"+ ss +"'");
//String stud="update persons set tt='"+tt1+"' where name='"+name1+"'";
while(rs.next()){
System.out.println(rs.getString("code")); //这里错了
}
//System.out.println(rs.getInt("roomNum"));
}catch(Exception e)
{
e.printStackTrace();
}
}
connect to q user username using password