class JdbcMetadataBuilder implements MetadataBuilder<Connection>,
        ParametrizedMetadataBuilder<Connection, PartialMetadataOptions> {

    protected void setResult(List<String> result, ResultSet resultSet) throws SQLException {
    	RowSetFactory aFactory = RowSetProvider.newFactory();
    	CachedRowSet cachedRowSet = aFactory.createCachedRowSet();
        cachedRowSet.populate(resultSet);

        // CachedRowSet is wrapped by ResultSetWrappingSqlRowSet to allow using Column labels for rs.getString()
        ResultSetWrappingSqlRowSet resultSetWrappingSqlRowSet = getResultSetWrappingSqlRowSet(cachedRowSet);

        if (resultSetWrappingSqlRowSet.isBeforeFirst()) {
            while (resultSetWrappingSqlRowSet.next()) {
                result.add(resultSetWrappingSqlRowSet.getString("TABLE_SCHEM"));
            }
        }
        cachedRowSet.close();
    }

}