@Test public void shouldImplementGetTables() throws Exception { ResultSet result = metadata.getTables(null, null, null, null); assertThat(result, is(notNullValue())); }
@SuppressWarnings( "unchecked" ) @Override public ResultSet getTables( String catalog, String schemaPattern, String tableNamePattern, String[] types ) throws SQLException { LocalJcrDriver.logger.debug("getTables: " + catalog + ":" + schemaPattern + ":" + tableNamePattern + ":" + types); if (tableNamePattern == null) { tableNamePattern = WILDCARD; } Map<?, Object>[] metadataList = new Map[JDBCColumnPositions.TABLES.MAX_COLUMNS]; metadataList[0] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TABLE_CAT, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[1] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TABLE_SCHEM, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[2] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TABLE_NAME, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, this.connection); metadataList[3] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TABLE_TYPE, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, this.connection); metadataList[4] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.REMARKS, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[5] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TYPE_CAT, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[6] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TYPE_SCHEM, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[7] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TYPE_NAME, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[8] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.SELF_REFERENCING_COL_NAME, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[9] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.REF_GENERATION, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); MetadataProvider provider = new MetadataProvider(metadataList); ResultSetMetaDataImpl resultSetMetaData = new ResultSetMetaDataImpl(provider); List<List<?>> records = new ArrayList<List<?>>(); try { List<NodeType> nodetypes = filterNodeTypes(tableNamePattern); for (NodeType type : nodetypes) { if (!type.isQueryable()) { continue; } List<Object> currentRow = new ArrayList<Object>(JDBCColumnPositions.TABLES.MAX_COLUMNS); currentRow.add(catalogName); currentRow.add("NULL"); currentRow.add(type.getName()); currentRow.add(ResultsMetadataConstants.TABLE_TYPES.VIEW); currentRow.add("Is Mixin: " + type.isMixin()); currentRow.add("NULL"); currentRow.add("NULL"); currentRow.add("NULL"); currentRow.add(type.getPrimaryItemName()); currentRow.add("DERIVED"); records.add(currentRow); } JcrStatement jcrstmt = new JcrStatement(this.connection); QueryResult queryresult = MetaDataQueryResult.createResultSet(records, resultSetMetaData); return new JcrResultSet(jcrstmt, queryresult, resultSetMetaData); } catch (RepositoryException e) { throw new SQLException(e.getLocalizedMessage()); } }
JcrMetaData implements DatabaseMetaData { @SuppressWarnings( "unchecked" ) @Override public ResultSet getTables( String catalog, String schemaPattern, String tableNamePattern, String[] types ) throws SQLException { LocalJcrDriver.logger.debug("getTables: " + catalog + ":" + schemaPattern + ":" + tableNamePattern + ":" + types); if (tableNamePattern == null) { tableNamePattern = WILDCARD; } Map<?, Object>[] metadataList = new Map[JDBCColumnPositions.TABLES.MAX_COLUMNS]; metadataList[0] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TABLE_CAT, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[1] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TABLE_SCHEM, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[2] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TABLE_NAME, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, this.connection); metadataList[3] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TABLE_TYPE, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, this.connection); metadataList[4] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.REMARKS, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[5] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TYPE_CAT, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[6] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TYPE_SCHEM, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[7] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TYPE_NAME, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[8] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.SELF_REFERENCING_COL_NAME, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[9] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.REF_GENERATION, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); MetadataProvider provider = new MetadataProvider(metadataList); ResultSetMetaDataImpl resultSetMetaData = new ResultSetMetaDataImpl(provider); List<List<?>> records = new ArrayList<List<?>>(); try { List<NodeType> nodetypes = filterNodeTypes(tableNamePattern); for (NodeType type : nodetypes) { if (!type.isQueryable()) { continue; } List<Object> currentRow = new ArrayList<Object>(JDBCColumnPositions.TABLES.MAX_COLUMNS); currentRow.add(catalogName); currentRow.add("NULL"); currentRow.add(type.getName()); currentRow.add(ResultsMetadataConstants.TABLE_TYPES.VIEW); currentRow.add("Is Mixin: " + type.isMixin()); currentRow.add("NULL"); currentRow.add("NULL"); currentRow.add("NULL"); currentRow.add(type.getPrimaryItemName()); currentRow.add("DERIVED"); records.add(currentRow); } JcrStatement jcrstmt = new JcrStatement(this.connection); QueryResult queryresult = MetaDataQueryResult.createResultSet(records, resultSetMetaData); return new JcrResultSet(jcrstmt, queryresult, resultSetMetaData); } catch (RepositoryException e) { throw new SQLException(e.getLocalizedMessage()); } } }
JcrMetaData implements DatabaseMetaData { @SuppressWarnings( "unchecked" ) @Override public ResultSet getTables( String catalog, String schemaPattern, String tableNamePattern, String[] types ) throws SQLException { LocalJcrDriver.logger.debug("getTables: " + catalog + ":" + schemaPattern + ":" + tableNamePattern + ":" + types); if (tableNamePattern == null) { tableNamePattern = WILDCARD; } Map<?, Object>[] metadataList = new Map[JDBCColumnPositions.TABLES.MAX_COLUMNS]; metadataList[0] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TABLE_CAT, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[1] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TABLE_SCHEM, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[2] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TABLE_NAME, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, this.connection); metadataList[3] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TABLE_TYPE, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, this.connection); metadataList[4] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.REMARKS, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[5] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TYPE_CAT, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[6] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TYPE_SCHEM, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[7] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TYPE_NAME, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[8] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.SELF_REFERENCING_COL_NAME, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[9] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.REF_GENERATION, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); MetadataProvider provider = new MetadataProvider(metadataList); ResultSetMetaDataImpl resultSetMetaData = new ResultSetMetaDataImpl(provider); List<List<?>> records = new ArrayList<List<?>>(); try { List<NodeType> nodetypes = filterNodeTypes(tableNamePattern); for (NodeType type : nodetypes) { if (!type.isQueryable()) { continue; } List<Object> currentRow = new ArrayList<Object>(JDBCColumnPositions.TABLES.MAX_COLUMNS); currentRow.add(catalogName); currentRow.add("NULL"); currentRow.add(type.getName()); currentRow.add(ResultsMetadataConstants.TABLE_TYPES.VIEW); currentRow.add("Is Mixin: " + type.isMixin()); currentRow.add("NULL"); currentRow.add("NULL"); currentRow.add("NULL"); currentRow.add(type.getPrimaryItemName()); currentRow.add("DERIVED"); records.add(currentRow); } JcrStatement jcrstmt = new JcrStatement(this.connection); QueryResult queryresult = MetaDataQueryResult.createResultSet(records, resultSetMetaData); return new JcrResultSet(jcrstmt, queryresult, resultSetMetaData); } catch (RepositoryException e) { throw new SQLException(e.getLocalizedMessage()); } } JcrMetaData( JcrConnection connection ); }
JcrMetaData implements DatabaseMetaData { @SuppressWarnings( "unchecked" ) @Override public ResultSet getTables( String catalog, String schemaPattern, String tableNamePattern, String[] types ) throws SQLException { LocalJcrDriver.logger.debug("getTables: " + catalog + ":" + schemaPattern + ":" + tableNamePattern + ":" + types); if (tableNamePattern == null) { tableNamePattern = WILDCARD; } Map<?, Object>[] metadataList = new Map[JDBCColumnPositions.TABLES.MAX_COLUMNS]; metadataList[0] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TABLE_CAT, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[1] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TABLE_SCHEM, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[2] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TABLE_NAME, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, this.connection); metadataList[3] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TABLE_TYPE, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, this.connection); metadataList[4] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.REMARKS, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[5] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TYPE_CAT, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[6] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TYPE_SCHEM, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[7] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TYPE_NAME, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[8] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.SELF_REFERENCING_COL_NAME, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[9] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.REF_GENERATION, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); MetadataProvider provider = new MetadataProvider(metadataList); ResultSetMetaDataImpl resultSetMetaData = new ResultSetMetaDataImpl(provider); List<List<?>> records = new ArrayList<List<?>>(); try { List<NodeType> nodetypes = filterNodeTypes(tableNamePattern); for (NodeType type : nodetypes) { if (!type.isQueryable()) { continue; } List<Object> currentRow = new ArrayList<Object>(JDBCColumnPositions.TABLES.MAX_COLUMNS); currentRow.add(catalogName); currentRow.add("NULL"); currentRow.add(type.getName()); currentRow.add(ResultsMetadataConstants.TABLE_TYPES.VIEW); currentRow.add("Is Mixin: " + type.isMixin()); currentRow.add("NULL"); currentRow.add("NULL"); currentRow.add("NULL"); currentRow.add(type.getPrimaryItemName()); currentRow.add("DERIVED"); records.add(currentRow); } JcrStatement jcrstmt = new JcrStatement(this.connection); QueryResult queryresult = MetaDataQueryResult.createResultSet(records, resultSetMetaData); return new JcrResultSet(jcrstmt, queryresult, resultSetMetaData); } catch (RepositoryException e) { throw new SQLException(e.getLocalizedMessage()); } } JcrMetaData( JcrConnection connection ); @Override ResultSet getPseudoColumns( String catalog,
                                       String schemaPattern,
                                       String tableNamePattern,
                                       String columnNamePattern ); @Override boolean generatedKeyAlwaysReturned(); @Override int getDriverMajorVersion(); @Override int getDriverMinorVersion(); @Override String getDriverName(); @Override String getDriverVersion(); @Override int getDatabaseMajorVersion(); @Override int getDatabaseMinorVersion(); @Override String getDatabaseProductName(); String getDatabaseProductUrl(); @Override String getDatabaseProductVersion(); @Override int getJDBCMajorVersion(); @Override int getJDBCMinorVersion(); @Override Connection getConnection(); @Override boolean isReadOnly(); @Override boolean allProceduresAreCallable(); @Override boolean allTablesAreSelectable(); @Override boolean autoCommitFailureClosesAllResultSets(); @Override boolean dataDefinitionCausesTransactionCommit(); @Override boolean dataDefinitionIgnoredInTransactions(); @Override boolean deletesAreDetected( int type ); @Override boolean doesMaxRowSizeIncludeBlobs(); @Override ResultSet getAttributes( String catalog,
                                    String schemaPattern,
                                    String typeNamePattern,
                                    String attributeNamePattern ); @Override ResultSet getBestRowIdentifier( String catalog,
                                           String schema,
                                           String table,
                                           int scope,
                                           boolean nullable ); @Override String getCatalogSeparator(); @Override String getCatalogTerm(); @SuppressWarnings( "unchecked" ) @Override ResultSet getCatalogs(); @Override ResultSet getClientInfoProperties(); @Override ResultSet getColumnPrivileges( String catalog,
                                          String schema,
                                          String table,
                                          String columnNamePattern ); @SuppressWarnings( "unchecked" ) @Override ResultSet getColumns( String catalog,
                                 String schemaPattern,
                                 String tableNamePattern,
                                 String columnNamePattern ); @Override ResultSet getCrossReference( String parentCatalog,
                                        String parentSchema,
                                        String parentTable,
                                        String foreignCatalog,
                                        String foreignSchema,
                                        String foreignTable ); @Override int getDefaultTransactionIsolation(); @Override ResultSet getExportedKeys( String catalog,
                                      String schema,
                                      String table ); @Override String getExtraNameCharacters(); @Override ResultSet getFunctionColumns( String catalog,
                                         String schemaPattern,
                                         String functionNamePattern,
                                         String columnNamePattern ); @Override ResultSet getFunctions( String catalog,
                                   String schemaPattern,
                                   String functionNamePattern ); @Override String getIdentifierQuoteString(); @Override ResultSet getImportedKeys( String catalog,
                                      String schema,
                                      String table ); @SuppressWarnings( "unchecked" ) @Override ResultSet getIndexInfo( String catalog,
                                   String schema,
                                   String tableNamePattern,
                                   boolean unique,
                                   boolean approximate ); @Override int getMaxBinaryLiteralLength(); @Override int getMaxCatalogNameLength(); @Override int getMaxCharLiteralLength(); @Override int getMaxColumnNameLength(); @Override int getMaxColumnsInGroupBy(); @Override int getMaxColumnsInIndex(); @Override int getMaxColumnsInOrderBy(); @Override int getMaxColumnsInSelect(); @Override int getMaxColumnsInTable(); @Override int getMaxConnections(); @Override int getMaxCursorNameLength(); @Override int getMaxIndexLength(); @Override int getMaxProcedureNameLength(); @Override int getMaxRowSize(); @Override int getMaxSchemaNameLength(); @Override int getMaxStatementLength(); @Override int getMaxStatements(); @Override int getMaxTableNameLength(); @Override int getMaxTablesInSelect(); @Override int getMaxUserNameLength(); @Override String getNumericFunctions(); @SuppressWarnings( "unchecked" ) @Override ResultSet getPrimaryKeys( String catalog,
                                     String schema,
                                     String tableNamePattern ); @Override ResultSet getProcedureColumns( String catalog,
                                          String schemaPattern,
                                          String procedureNamePattern,
                                          String columnNamePattern ); @Override String getProcedureTerm(); @Override ResultSet getProcedures( String catalog,
                                    String schemaPattern,
                                    String procedureNamePattern ); @Override int getResultSetHoldability(); @Override RowIdLifetime getRowIdLifetime(); @Override String getSQLKeywords(); @Override int getSQLStateType(); @Override String getSchemaTerm(); @SuppressWarnings( "unchecked" ) @Override ResultSet getSchemas(); @Override ResultSet getSchemas( String catalog,
                                 String schemaPattern ); @Override String getSearchStringEscape(); @Override String getStringFunctions(); @Override ResultSet getSuperTables( String catalog,
                                     String schemaPattern,
                                     String tableNamePattern ); @Override ResultSet getSuperTypes( String catalog,
                                    String schemaPattern,
                                    String typeNamePattern ); @Override String getSystemFunctions(); @Override ResultSet getTablePrivileges( String catalog,
                                         String schemaPattern,
                                         String tableNamePattern ); @SuppressWarnings( "unchecked" ) @Override ResultSet getTableTypes(); @SuppressWarnings( "unchecked" ) @Override ResultSet getTables( String catalog,
                                String schemaPattern,
                                String tableNamePattern,
                                String[] types ); @Override String getTimeDateFunctions(); @Override ResultSet getTypeInfo(); @Override ResultSet getUDTs( String catalog,
                              String schemaPattern,
                              String typeNamePattern,
                              int[] types ); @Override String getURL(); @Override String getUserName(); @Override ResultSet getVersionColumns( String catalog,
                                        String schema,
                                        String table ); @Override boolean insertsAreDetected( int type ); @Override boolean isCatalogAtStart(); @Override boolean locatorsUpdateCopy(); @Override boolean nullPlusNonNullIsNull(); @Override boolean nullsAreSortedAtEnd(); @Override boolean nullsAreSortedAtStart(); @Override boolean nullsAreSortedHigh(); @Override boolean nullsAreSortedLow(); @Override boolean othersDeletesAreVisible( int type ); @Override boolean othersInsertsAreVisible( int type ); @Override boolean othersUpdatesAreVisible( int type ); @Override boolean ownDeletesAreVisible( int type ); @Override boolean ownInsertsAreVisible( int type ); @Override boolean ownUpdatesAreVisible( int type ); @Override boolean storesLowerCaseIdentifiers(); @Override boolean storesLowerCaseQuotedIdentifiers(); @Override boolean storesMixedCaseIdentifiers(); @Override boolean storesMixedCaseQuotedIdentifiers(); @Override boolean storesUpperCaseIdentifiers(); @Override boolean storesUpperCaseQuotedIdentifiers(); @Override boolean supportsANSI92EntryLevelSQL(); @Override boolean supportsANSI92FullSQL(); @Override boolean supportsANSI92IntermediateSQL(); @Override boolean supportsAlterTableWithAddColumn(); @Override boolean supportsAlterTableWithDropColumn(); @Override boolean supportsBatchUpdates(); @Override boolean supportsCatalogsInDataManipulation(); @Override boolean supportsCatalogsInIndexDefinitions(); @Override boolean supportsCatalogsInPrivilegeDefinitions(); @Override boolean supportsCatalogsInProcedureCalls(); @Override boolean supportsCatalogsInTableDefinitions(); @Override boolean supportsColumnAliasing(); @Override boolean supportsConvert(); @Override boolean supportsConvert( int fromType,
                                    int toType ); @Override boolean supportsCoreSQLGrammar(); @Override boolean supportsCorrelatedSubqueries(); @Override boolean supportsDataDefinitionAndDataManipulationTransactions(); @Override boolean supportsDataManipulationTransactionsOnly(); @Override boolean supportsDifferentTableCorrelationNames(); @Override boolean supportsExpressionsInOrderBy(); @Override boolean supportsExtendedSQLGrammar(); @Override boolean supportsFullOuterJoins(); @Override boolean supportsGetGeneratedKeys(); @Override boolean supportsGroupBy(); @Override boolean supportsGroupByBeyondSelect(); @Override boolean supportsGroupByUnrelated(); @Override boolean supportsIntegrityEnhancementFacility(); @Override boolean supportsLikeEscapeClause(); @Override boolean supportsLimitedOuterJoins(); @Override boolean supportsMinimumSQLGrammar(); @Override boolean supportsMixedCaseIdentifiers(); @Override boolean supportsMixedCaseQuotedIdentifiers(); @Override boolean supportsMultipleOpenResults(); @Override boolean supportsMultipleResultSets(); @Override boolean supportsMultipleTransactions(); @Override boolean supportsNamedParameters(); @Override boolean supportsNonNullableColumns(); @Override boolean supportsOpenCursorsAcrossCommit(); @Override boolean supportsOpenCursorsAcrossRollback(); @Override boolean supportsOpenStatementsAcrossCommit(); @Override boolean supportsOpenStatementsAcrossRollback(); @Override boolean supportsOrderByUnrelated(); @Override boolean supportsOuterJoins(); @Override boolean supportsPositionedDelete(); @Override boolean supportsPositionedUpdate(); @Override boolean supportsResultSetConcurrency( int type,
                                                 int concurrency ); @Override boolean supportsResultSetHoldability( int holdability ); @Override boolean supportsResultSetType( int type ); @Override boolean supportsSavepoints(); @Override boolean supportsSchemasInDataManipulation(); @Override boolean supportsSchemasInIndexDefinitions(); @Override boolean supportsSchemasInPrivilegeDefinitions(); @Override boolean supportsSchemasInProcedureCalls(); @Override boolean supportsSchemasInTableDefinitions(); @Override boolean supportsSelectForUpdate(); @Override boolean supportsStatementPooling(); @Override boolean supportsStoredFunctionsUsingCallSyntax(); @Override boolean supportsStoredProcedures(); @Override boolean supportsSubqueriesInComparisons(); @Override boolean supportsSubqueriesInExists(); @Override boolean supportsSubqueriesInIns(); @Override boolean supportsSubqueriesInQuantifieds(); @Override boolean supportsTableCorrelationNames(); @Override boolean supportsTransactionIsolationLevel( int level ); @Override boolean supportsTransactions(); @Override boolean supportsUnion(); @Override boolean supportsUnionAll(); @Override boolean updatesAreDetected( int type ); @Override boolean usesLocalFilePerTable(); @Override boolean usesLocalFiles(); @Override boolean isWrapperFor( Class<?> iface ); @Override T unwrap( Class<T> iface ); }
JcrMetaData implements DatabaseMetaData { @SuppressWarnings( "unchecked" ) @Override public ResultSet getTables( String catalog, String schemaPattern, String tableNamePattern, String[] types ) throws SQLException { LocalJcrDriver.logger.debug("getTables: " + catalog + ":" + schemaPattern + ":" + tableNamePattern + ":" + types); if (tableNamePattern == null) { tableNamePattern = WILDCARD; } Map<?, Object>[] metadataList = new Map[JDBCColumnPositions.TABLES.MAX_COLUMNS]; metadataList[0] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TABLE_CAT, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[1] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TABLE_SCHEM, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[2] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TABLE_NAME, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, this.connection); metadataList[3] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TABLE_TYPE, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NOT_NULL, this.connection); metadataList[4] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.REMARKS, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[5] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TYPE_CAT, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[6] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TYPE_SCHEM, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[7] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.TYPE_NAME, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[8] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.SELF_REFERENCING_COL_NAME, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); metadataList[9] = MetadataProvider.getColumnMetadata(catalogName, null, JDBCColumnNames.TABLES.REF_GENERATION, JcrType.DefaultDataTypes.STRING, ResultsMetadataConstants.NULL_TYPES.NULLABLE, this.connection); MetadataProvider provider = new MetadataProvider(metadataList); ResultSetMetaDataImpl resultSetMetaData = new ResultSetMetaDataImpl(provider); List<List<?>> records = new ArrayList<List<?>>(); try { List<NodeType> nodetypes = filterNodeTypes(tableNamePattern); for (NodeType type : nodetypes) { if (!type.isQueryable()) { continue; } List<Object> currentRow = new ArrayList<Object>(JDBCColumnPositions.TABLES.MAX_COLUMNS); currentRow.add(catalogName); currentRow.add("NULL"); currentRow.add(type.getName()); currentRow.add(ResultsMetadataConstants.TABLE_TYPES.VIEW); currentRow.add("Is Mixin: " + type.isMixin()); currentRow.add("NULL"); currentRow.add("NULL"); currentRow.add("NULL"); currentRow.add(type.getPrimaryItemName()); currentRow.add("DERIVED"); records.add(currentRow); } JcrStatement jcrstmt = new JcrStatement(this.connection); QueryResult queryresult = MetaDataQueryResult.createResultSet(records, resultSetMetaData); return new JcrResultSet(jcrstmt, queryresult, resultSetMetaData); } catch (RepositoryException e) { throw new SQLException(e.getLocalizedMessage()); } } JcrMetaData( JcrConnection connection ); @Override ResultSet getPseudoColumns( String catalog,
                                       String schemaPattern,
                                       String tableNamePattern,
                                       String columnNamePattern ); @Override boolean generatedKeyAlwaysReturned(); @Override int getDriverMajorVersion(); @Override int getDriverMinorVersion(); @Override String getDriverName(); @Override String getDriverVersion(); @Override int getDatabaseMajorVersion(); @Override int getDatabaseMinorVersion(); @Override String getDatabaseProductName(); String getDatabaseProductUrl(); @Override String getDatabaseProductVersion(); @Override int getJDBCMajorVersion(); @Override int getJDBCMinorVersion(); @Override Connection getConnection(); @Override boolean isReadOnly(); @Override boolean allProceduresAreCallable(); @Override boolean allTablesAreSelectable(); @Override boolean autoCommitFailureClosesAllResultSets(); @Override boolean dataDefinitionCausesTransactionCommit(); @Override boolean dataDefinitionIgnoredInTransactions(); @Override boolean deletesAreDetected( int type ); @Override boolean doesMaxRowSizeIncludeBlobs(); @Override ResultSet getAttributes( String catalog,
                                    String schemaPattern,
                                    String typeNamePattern,
                                    String attributeNamePattern ); @Override ResultSet getBestRowIdentifier( String catalog,
                                           String schema,
                                           String table,
                                           int scope,
                                           boolean nullable ); @Override String getCatalogSeparator(); @Override String getCatalogTerm(); @SuppressWarnings( "unchecked" ) @Override ResultSet getCatalogs(); @Override ResultSet getClientInfoProperties(); @Override ResultSet getColumnPrivileges( String catalog,
                                          String schema,
                                          String table,
                                          String columnNamePattern ); @SuppressWarnings( "unchecked" ) @Override ResultSet getColumns( String catalog,
                                 String schemaPattern,
                                 String tableNamePattern,
                                 String columnNamePattern ); @Override ResultSet getCrossReference( String parentCatalog,
                                        String parentSchema,
                                        String parentTable,
                                        String foreignCatalog,
                                        String foreignSchema,
                                        String foreignTable ); @Override int getDefaultTransactionIsolation(); @Override ResultSet getExportedKeys( String catalog,
                                      String schema,
                                      String table ); @Override String getExtraNameCharacters(); @Override ResultSet getFunctionColumns( String catalog,
                                         String schemaPattern,
                                         String functionNamePattern,
                                         String columnNamePattern ); @Override ResultSet getFunctions( String catalog,
                                   String schemaPattern,
                                   String functionNamePattern ); @Override String getIdentifierQuoteString(); @Override ResultSet getImportedKeys( String catalog,
                                      String schema,
                                      String table ); @SuppressWarnings( "unchecked" ) @Override ResultSet getIndexInfo( String catalog,
                                   String schema,
                                   String tableNamePattern,
                                   boolean unique,
                                   boolean approximate ); @Override int getMaxBinaryLiteralLength(); @Override int getMaxCatalogNameLength(); @Override int getMaxCharLiteralLength(); @Override int getMaxColumnNameLength(); @Override int getMaxColumnsInGroupBy(); @Override int getMaxColumnsInIndex(); @Override int getMaxColumnsInOrderBy(); @Override int getMaxColumnsInSelect(); @Override int getMaxColumnsInTable(); @Override int getMaxConnections(); @Override int getMaxCursorNameLength(); @Override int getMaxIndexLength(); @Override int getMaxProcedureNameLength(); @Override int getMaxRowSize(); @Override int getMaxSchemaNameLength(); @Override int getMaxStatementLength(); @Override int getMaxStatements(); @Override int getMaxTableNameLength(); @Override int getMaxTablesInSelect(); @Override int getMaxUserNameLength(); @Override String getNumericFunctions(); @SuppressWarnings( "unchecked" ) @Override ResultSet getPrimaryKeys( String catalog,
                                     String schema,
                                     String tableNamePattern ); @Override ResultSet getProcedureColumns( String catalog,
                                          String schemaPattern,
                                          String procedureNamePattern,
                                          String columnNamePattern ); @Override String getProcedureTerm(); @Override ResultSet getProcedures( String catalog,
                                    String schemaPattern,
                                    String procedureNamePattern ); @Override int getResultSetHoldability(); @Override RowIdLifetime getRowIdLifetime(); @Override String getSQLKeywords(); @Override int getSQLStateType(); @Override String getSchemaTerm(); @SuppressWarnings( "unchecked" ) @Override ResultSet getSchemas(); @Override ResultSet getSchemas( String catalog,
                                 String schemaPattern ); @Override String getSearchStringEscape(); @Override String getStringFunctions(); @Override ResultSet getSuperTables( String catalog,
                                     String schemaPattern,
                                     String tableNamePattern ); @Override ResultSet getSuperTypes( String catalog,
                                    String schemaPattern,
                                    String typeNamePattern ); @Override String getSystemFunctions(); @Override ResultSet getTablePrivileges( String catalog,
                                         String schemaPattern,
                                         String tableNamePattern ); @SuppressWarnings( "unchecked" ) @Override ResultSet getTableTypes(); @SuppressWarnings( "unchecked" ) @Override ResultSet getTables( String catalog,
                                String schemaPattern,
                                String tableNamePattern,
                                String[] types ); @Override String getTimeDateFunctions(); @Override ResultSet getTypeInfo(); @Override ResultSet getUDTs( String catalog,
                              String schemaPattern,
                              String typeNamePattern,
                              int[] types ); @Override String getURL(); @Override String getUserName(); @Override ResultSet getVersionColumns( String catalog,
                                        String schema,
                                        String table ); @Override boolean insertsAreDetected( int type ); @Override boolean isCatalogAtStart(); @Override boolean locatorsUpdateCopy(); @Override boolean nullPlusNonNullIsNull(); @Override boolean nullsAreSortedAtEnd(); @Override boolean nullsAreSortedAtStart(); @Override boolean nullsAreSortedHigh(); @Override boolean nullsAreSortedLow(); @Override boolean othersDeletesAreVisible( int type ); @Override boolean othersInsertsAreVisible( int type ); @Override boolean othersUpdatesAreVisible( int type ); @Override boolean ownDeletesAreVisible( int type ); @Override boolean ownInsertsAreVisible( int type ); @Override boolean ownUpdatesAreVisible( int type ); @Override boolean storesLowerCaseIdentifiers(); @Override boolean storesLowerCaseQuotedIdentifiers(); @Override boolean storesMixedCaseIdentifiers(); @Override boolean storesMixedCaseQuotedIdentifiers(); @Override boolean storesUpperCaseIdentifiers(); @Override boolean storesUpperCaseQuotedIdentifiers(); @Override boolean supportsANSI92EntryLevelSQL(); @Override boolean supportsANSI92FullSQL(); @Override boolean supportsANSI92IntermediateSQL(); @Override boolean supportsAlterTableWithAddColumn(); @Override boolean supportsAlterTableWithDropColumn(); @Override boolean supportsBatchUpdates(); @Override boolean supportsCatalogsInDataManipulation(); @Override boolean supportsCatalogsInIndexDefinitions(); @Override boolean supportsCatalogsInPrivilegeDefinitions(); @Override boolean supportsCatalogsInProcedureCalls(); @Override boolean supportsCatalogsInTableDefinitions(); @Override boolean supportsColumnAliasing(); @Override boolean supportsConvert(); @Override boolean supportsConvert( int fromType,
                                    int toType ); @Override boolean supportsCoreSQLGrammar(); @Override boolean supportsCorrelatedSubqueries(); @Override boolean supportsDataDefinitionAndDataManipulationTransactions(); @Override boolean supportsDataManipulationTransactionsOnly(); @Override boolean supportsDifferentTableCorrelationNames(); @Override boolean supportsExpressionsInOrderBy(); @Override boolean supportsExtendedSQLGrammar(); @Override boolean supportsFullOuterJoins(); @Override boolean supportsGetGeneratedKeys(); @Override boolean supportsGroupBy(); @Override boolean supportsGroupByBeyondSelect(); @Override boolean supportsGroupByUnrelated(); @Override boolean supportsIntegrityEnhancementFacility(); @Override boolean supportsLikeEscapeClause(); @Override boolean supportsLimitedOuterJoins(); @Override boolean supportsMinimumSQLGrammar(); @Override boolean supportsMixedCaseIdentifiers(); @Override boolean supportsMixedCaseQuotedIdentifiers(); @Override boolean supportsMultipleOpenResults(); @Override boolean supportsMultipleResultSets(); @Override boolean supportsMultipleTransactions(); @Override boolean supportsNamedParameters(); @Override boolean supportsNonNullableColumns(); @Override boolean supportsOpenCursorsAcrossCommit(); @Override boolean supportsOpenCursorsAcrossRollback(); @Override boolean supportsOpenStatementsAcrossCommit(); @Override boolean supportsOpenStatementsAcrossRollback(); @Override boolean supportsOrderByUnrelated(); @Override boolean supportsOuterJoins(); @Override boolean supportsPositionedDelete(); @Override boolean supportsPositionedUpdate(); @Override boolean supportsResultSetConcurrency( int type,
                                                 int concurrency ); @Override boolean supportsResultSetHoldability( int holdability ); @Override boolean supportsResultSetType( int type ); @Override boolean supportsSavepoints(); @Override boolean supportsSchemasInDataManipulation(); @Override boolean supportsSchemasInIndexDefinitions(); @Override boolean supportsSchemasInPrivilegeDefinitions(); @Override boolean supportsSchemasInProcedureCalls(); @Override boolean supportsSchemasInTableDefinitions(); @Override boolean supportsSelectForUpdate(); @Override boolean supportsStatementPooling(); @Override boolean supportsStoredFunctionsUsingCallSyntax(); @Override boolean supportsStoredProcedures(); @Override boolean supportsSubqueriesInComparisons(); @Override boolean supportsSubqueriesInExists(); @Override boolean supportsSubqueriesInIns(); @Override boolean supportsSubqueriesInQuantifieds(); @Override boolean supportsTableCorrelationNames(); @Override boolean supportsTransactionIsolationLevel( int level ); @Override boolean supportsTransactions(); @Override boolean supportsUnion(); @Override boolean supportsUnionAll(); @Override boolean updatesAreDetected( int type ); @Override boolean usesLocalFilePerTable(); @Override boolean usesLocalFiles(); @Override boolean isWrapperFor( Class<?> iface ); @Override T unwrap( Class<T> iface );  }