}catch(classnotfoundexception e){
system.out.print(e);
}
try{
con=drivermanager.getconnection("jdbc:microsoft:sqlserver://localhost:1433;
databasename=student;","sa","");
}catch(sqlexception e){
system.out.print(e);
}
}
public resultset myquery(string sql) throws sqlexception{
//结果集的游标可上下移动,但当数据库变化时,结果集不变,
//不能用结果集更新数据库中的表