rs.close();
if (rs != null) { try { rs.close(); } catch (SQLException e1) { throw new IOException(e1.getMessage()); } }
    private void loadCache() throws SQLException, IOException {        PreparedStatement query = getPreparedStatement(SQL_GET_SEQNUMS);        query.setString(1, sessionID.getBeginString());        query.setString(2, sessionID.getSenderCompID());        query.setString(3, sessionID.getTargetCompID());        query.setString(4, sessionID.getSessionQualifier());        ResultSet rs = null;        try {            rs = query.executeQuery();            if (rs.next()) {                cache.setCreationTime(SystemTime.getUtcCalendar(rs.getDate(1)));                cache.setNextTargetMsgSeqNum(rs.getInt(2));                cache.setNextSenderMsgSeqNum(rs.getInt(3));            } else {                PreparedStatement insert = getPreparedStatement(SQL_INSERT_SESSION);                insert.setString(1, sessionID.getBeginString());                insert.setString(2, sessionID.getSenderCompID());                insert.setString(3, sessionID.getTargetCompID());                insert.setString(4, sessionID.getSessionQualifier());                insert.setTimestamp(5, new Timestamp(cache.getCreationTime().getTime()));                insert.setInt(6, cache.getNextTargetMsgSeqNum());                insert.setInt(7, cache.getNextSenderMsgSeqNum());                insert.execute();            }        } finally {            rs.close();        }    }