@Nullable
    private Long loadServiceID(@Nonnull final String subdomain) {
        Connection con = null;
        PreparedStatement pstmt = null;
        ResultSet rs = null;
        Long id = null;
        try {
            con = DbConnectionManager.getConnection();
            pstmt = con.prepareStatement(LOAD_SERVICE_ID);
            pstmt.setString(1, subdomain);
            rs = pstmt.executeQuery();
            if (rs.next()) {
                id = rs.getLong(1);
            }
            else {
                throw new Exception("Unable to locate Service ID for subdomain "+subdomain);
            }
        }
        catch (Exception e) {
            Log.error("A database exception occurred while trying to load the ID for MUC service '{}' from the database.", subdomain, e);
        }
        finally {
            DbConnectionManager.closeConnection(rs, pstmt, con);
        }
        Log.trace("Loaded service ID for MUC service '{}'", subdomain);
        return id;
    }
Gets a specific subdomain/service's ID number.

@param subdomain Subdomain to retrieve ID for.
@return ID number of service, or null if no such service was found
xmppserver/src/main/java/org/jivesoftware/openfire/muc/MultiUserChatManager.java