class JcrMetaData implements DatabaseMetaData {

    @Override
    public ResultSet getImportedKeys( String catalog,
                                      String schema,
                                      String table ) throws SQLException {
        @SuppressWarnings( "unchecked" )
        Map<?, Object>[] metadataList = new Map[JDBCColumnPositions.REFERENCE_KEYS.MAX_COLUMNS];
        metadataList[0] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.REFERENCE_KEYS_INFO.PK_TABLE_CAT,
                                                             JcrType.DefaultDataTypes.STRING,
                                                             ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection);
        metadataList[1] = MetadataProvider.getColumnMetadata(catalogName, null,
                                                             JDBCColumnNames.REFERENCE_KEYS_INFO.PK_TABLE_SCHEM,
                                                             JcrType.DefaultDataTypes.STRING,
                                                             ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection);
        metadataList[2] = MetadataProvider.getColumnMetadata(catalogName, null,
                                                             JDBCColumnNames.REFERENCE_KEYS_INFO.PK_TABLE_NAME,
                                                             JcrType.DefaultDataTypes.STRING,
                                                             ResultsMetadataConstants.NULL_TYPES.NOT_NULL, this.connection);
        metadataList[3] = MetadataProvider.getColumnMetadata(catalogName, null,
                                                             JDBCColumnNames.REFERENCE_KEYS_INFO.PK_COLUMN_NAME,
                                                             JcrType.DefaultDataTypes.STRING,
                                                             ResultsMetadataConstants.NULL_TYPES.NOT_NULL, this.connection);
        metadataList[4] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.REFERENCE_KEYS_INFO.FK_TABLE_CAT,
                                                             JcrType.DefaultDataTypes.STRING,
                                                             ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection);
        metadataList[5] = MetadataProvider.getColumnMetadata(catalogName, null,
                                                             JDBCColumnNames.REFERENCE_KEYS_INFO.FK_TABLE_SCHEM,
                                                             JcrType.DefaultDataTypes.STRING,
                                                             ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection);
        metadataList[6] = MetadataProvider.getColumnMetadata(catalogName, null,
                                                             JDBCColumnNames.REFERENCE_KEYS_INFO.FK_TABLE_NAME,
                                                             JcrType.DefaultDataTypes.STRING,
                                                             ResultsMetadataConstants.NULL_TYPES.NOT_NULL, this.connection);
        metadataList[7] = MetadataProvider.getColumnMetadata(catalogName, null,
                                                             JDBCColumnNames.REFERENCE_KEYS_INFO.FK_COLUMN_NAME,
                                                             JcrType.DefaultDataTypes.STRING,
                                                             ResultsMetadataConstants.NULL_TYPES.NOT_NULL, this.connection);
        metadataList[8] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.REFERENCE_KEYS_INFO.KEY_SEQ,
                                                             JcrType.DefaultDataTypes.LONG,
                                                             ResultsMetadataConstants.NULL_TYPES.NOT_NULL, this.connection);
        metadataList[9] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.REFERENCE_KEYS_INFO.UPDATE_RULE,
                                                             JcrType.DefaultDataTypes.LONG,
                                                             ResultsMetadataConstants.NULL_TYPES.NOT_NULL, this.connection);
        metadataList[10] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.REFERENCE_KEYS_INFO.DELETE_RULE,
                                                              JcrType.DefaultDataTypes.LONG,
                                                              ResultsMetadataConstants.NULL_TYPES.NOT_NULL, this.connection);
        metadataList[11] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.REFERENCE_KEYS_INFO.FK_NAME,
                                                              JcrType.DefaultDataTypes.STRING,
                                                              ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection);
        metadataList[12] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.REFERENCE_KEYS_INFO.PK_NAME,
                                                              JcrType.DefaultDataTypes.STRING,
                                                              ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection);
        metadataList[13] = MetadataProvider.getColumnMetadata(catalogName, null,
                                                              JDBCColumnNames.REFERENCE_KEYS_INFO.DEFERRABILITY,
                                                              JcrType.DefaultDataTypes.LONG,
                                                              ResultsMetadataConstants.NULL_TYPES.NOT_NULL, this.connection);
        JcrStatement jcrstmt = new JcrStatement(this.connection);
        MetadataProvider provider = new MetadataProvider(metadataList);
        ResultSetMetaDataImpl resultSetMetaData = new ResultSetMetaDataImpl(provider);
        List<List<?>> records = Collections.emptyList();
        QueryResult queryresult = MetaDataQueryResult.createResultSet(records, resultSetMetaData);
        return new JcrResultSet(jcrstmt, queryresult, resultSetMetaData);
    }

    public  JcrMetaData( JcrConnection connection );

}