try{  con = getConnection();
try {  con = JDBCUtil.getDBConnection(JNDINames.DATASOURCE);
    public boolean checkForEndEntityProfileId(Admin admin, int endentityprofileid){        debug(">checkForEndEntityProfileId()");        Connection con = null;        PreparedStatement ps = null;        ResultSet rs = null;        int count = 1; // return true as default.        Query query = new Query(Query.TYPE_USERQUERY);        query.add(UserMatch.MATCH_WITH_ENDENTITYPROFILE, BasicMatch.MATCH_TYPE_EQUALS, Integer.toString(endentityprofileid));        try{           // Construct SQL query.            con = getConnection();            ps = con.prepareStatement("select COUNT(*) from UserData where " + query.getQueryString());            // Execute query.            rs = ps.executeQuery();            // Assemble result.            if(rs.next()){              count = rs.getInt(1);            }            debug("<checkForEndEntityProfileId()");            return count > 0;        }catch(Exception e){          throw new EJBException(e);        }finally{           JDBCUtil.close(con, ps, rs);        }    }