ps.setInt(3,UserDataLocal.STATUS_NEW); ps.setInt(4,UserDataLocal.STATUS_KEYRECOVERY);
ps.setInt(3,UserDataConstants.STATUS_NEW); ps.setInt(4,UserDataConstants.STATUS_KEYRECOVERY);
    public int getNumberOfHardTokensToGenerate(Admin admin, String alias){      debug(">getNumberOfHardTokensToGenerate()");      int count = 0;      int issuerid = getHardTokenSession().getHardTokenIssuerId(admin, alias);      if(issuerid != LocalHardTokenSessionBean.NO_ISSUER){        Connection con = null;        PreparedStatement ps = null;        ResultSet rs = null;        try{           // Construct SQL query.            con = JDBCUtil.getDBConnection(JNDINames.DATASOURCE);            ps = con.prepareStatement("select COUNT(*) from UserData where hardTokenIssuerId=? and tokenType>? and (status=? or status=?)");            ps.setInt(1,issuerid);            ps.setInt(2,SecConst.TOKEN_SOFT);			ps.setInt(3,UserDataLocal.STATUS_NEW);			ps.setInt(4,UserDataLocal.STATUS_KEYRECOVERY);            // Execute query.            rs = ps.executeQuery();            // Assemble result.            while(rs.next()){              count = rs.getInt(1);            }        }catch(Exception e){          throw new EJBException(e);        }finally{           JDBCUtil.close(con, ps, rs);        }      }      debug("<getNumberOfHardTokensToGenerate()");      return count;    }// getNumberOfHardTokensToGenerate