error("Fel vid upprensning: ", se);
error("Error cleaning up: ", se);
    public Collection findCertificatesByExpireTimeWithLimit(Admin admin, Date expiretime) {        debug(">findCertificatesByExpireTimeWithLimit");        Connection con = null;        PreparedStatement ps = null;        ;        ResultSet result = null;        ArrayList returnval = new ArrayList();        long currentdate = new Date().getTime();        try {            con = getConnection();            ps = con.prepareStatement(                    "SELECT DISTINCT username FROM CertificateData WHERE expireDate >= " +                    currentdate + " AND expireDate < " + expiretime.getTime() + " AND status = " +                    CertificateData.CERT_ACTIVE);            result = ps.executeQuery();            while (result.next() && (returnval.size() <= (SecConst.MAXIMUM_QUERY_ROWCOUNT + 1))) {                if ((result.getString(1) != null) && !result.getString(1).equals("")) {                    returnval.add(result.getString(1));                }            }            debug("<findCertificatesByExpireTimeWithLimit()");            return returnval;        } catch (Exception e) {            throw new EJBException(e);        } finally {            try {                if (result != null) {                    result.close();                }                if (ps != null) {                    ps.close();                }                if (con != null) {                    con.close();                }            } catch (SQLException se) {                error("Fel vid upprensning: ", se);            }        }    }