public List<User> getUserList() { List<User> userList = new ArrayList(); SSRS ssrs = es.execSQL("SELECT ID, USERNAME, PASSWORD, MENUJSON FROM SYJK_CCS_USER "); if (ssrs.MaxRow > 0) { for (int i = 0; i < ssrs.MaxRow; i++) { User user = new User(); user.setId(Integer.parseInt(ssrs.GetText(i + 1, 1))); user.setUserName(ssrs.GetText(i + 1, 2)); user.setPassWord(ssrs.GetText(i + 1, 3)); user.setMenujson(ssrs.GetText(i + 1, 4)); userList.add(user); } } return userList; }
/** * 用户名是否存在 * * @param username * @return */ public boolean isExist(String username) { SSRS ssrs = es.execSQL("SELECT 1 FROM SYJK_CCS_USER WHERE USERNAME = '******'"); return ssrs.getMaxRow() > 0; }