这段代码还有其它的表示方法嘛(更改一下代码)

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

      }

}

publicclass Login {

  public boolean checkLogin(String user_id, String user_pwd) {

         String sqlCmd = "select count(*) from user where user_id=? and user_pwd=?";

         String result = SQLUtil.excuteScalar(sqlCmd, new Object[2]{user_id, user_pwd}).toString();

         return result.equals("1") ? true : false;
  }

  public String getName(String user_id) {

         String sqlCmd = "select user_name from user where user_id=?";

         String result = SQLUtil.excuteScalar(sqlCmd, new Object[]{user_id}).toString();

         return result

  }

  public String getSysLevel(String user_id) {

         String sqlCmd = "select role_id from user where user_id=?";

         String result = SQLUtil.excuteScalar(sqlCmd, new Object[]{user_id}).toString();

         return result

  }

}