publicclass Login {
publicboolean checkLogin(String user_id, String user_pwd) {
String sqlCmd = "select count(*) from user where user_id=? and user_pwd=?";
Object[] objList = new Object[2];
objList[0] = user_id;
objList[1] = user_pwd;
String result = SQLUtil.excuteScalar(sqlCmd, objList).toString();
if (result.equals("1")) {
returntrue
} else {
returnfalse
}
}
public String getName(String user_id) {
String sqlCmd = "select user_name from user where user_id='" + user_id + "'";
String result = SQLUtil.excuteScalar(sqlCmd, null).toString();
return result
}
public String getSysLevel(String user_id) {
String sqlCmd = "select role_id from user where user_id='" + user_id + "'";
String result = SQLUtil.excuteScalar(sqlCmd, null).toString();
return result
}
}