public class CheckDAO{
public CheckIO getCheckDisp(String username) throws SQLException{
String sql="select * from admin where userName='"+username+"'";
DBConnect db=new DBConnect();
CheckIO checkio = new CheckIO();
try{
ResultSet rs=db.executeQuery(sql);
if(rs.next()){
checkio.setUsername(rs.getString("username"));
checkio.setPassword(rs.getString("password"));
}
}catch(SQLException e){
e.printStackTrace();
throw e;
}finally{
try{ db.close(); }
catch(Exception e){
e.printStackTrace();
}
}
return checkio;
}
}
编译后出现下面的错误 我也是刚开始编程序 希望各位老师能给予指点 谢谢大家了
unreported exception java.lang.Exception; must be caught or declared to be thrown
ResultSet rs=db.executeQuery(sql);
^
1 error