/** * Reflect on the schema to find indexes matching the given table pattern. */ public Index[] getIndexInfo(DatabaseMetaData meta, DBIdentifier catalog, DBIdentifier schemaName, DBIdentifier tableName, boolean unique, boolean approx, Connection conn) throws SQLException { if (tableName == null && !supportsNullTableForGetIndexInfo) return null; beforeMetadataOperation(conn); ResultSet indexes = null; try { indexes = meta.getIndexInfo(getCatalogNameForMetadata(catalog), getSchemaNameForMetadata(schemaName), getTableNameForMetadata(tableName), unique, approx); List indexList = new ArrayList(); while (indexes != null && indexes.next()) indexList.add(newIndex(indexes)); return (Index[]) indexList.toArray(new Index[indexList.size()]); } finally { if (indexes != null) try { indexes.close(); } catch (Exception e) { } } }
/** * Reflect on the schema to find indexes matching the given table pattern. */ public Index[] getIndexInfo(DatabaseMetaData meta, String catalog, String schemaName, String tableName, boolean unique, boolean approx, Connection conn) throws SQLException { if (tableName == null && !supportsNullTableForGetIndexInfo) return null; beforeMetadataOperation(conn); ResultSet indexes = null; try { indexes = meta.getIndexInfo(getCatalogNameForMetadata(catalog), getSchemaNameForMetadata(schemaName), getTableNameForMetadata(tableName), unique, approx); List indexList = new ArrayList(); while (indexes != null && indexes.next()) indexList.add(newIndex(indexes)); return (Index[]) indexList.toArray(new Index[indexList.size()]); } finally { if (indexes != null) try { indexes.close(); } catch (Exception e) { } } }
/** * Reflect on the schema to find indexes matching the given table pattern. */ public Index[] getIndexInfo(DatabaseMetaData meta, DBIdentifier catalog, DBIdentifier schemaName, DBIdentifier tableName, boolean unique, boolean approx, Connection conn) throws SQLException { if (tableName == null && !supportsNullTableForGetIndexInfo) return null; beforeMetadataOperation(conn); ResultSet indexes = null; try { indexes = meta.getIndexInfo(getCatalogNameForMetadata(catalog), getSchemaNameForMetadata(schemaName), getTableNameForMetadata(tableName), unique, approx); List indexList = new ArrayList(); while (indexes != null && indexes.next()) indexList.add(newIndex(indexes)); return (Index[]) indexList.toArray(new Index[indexList.size()]); } finally { if (indexes != null) try { indexes.close(); } catch (Exception e) { } } }
/** * Reflect on the schema to find primary keys for the given table pattern. */ protected PrimaryKey[] getPrimaryKeysFromGetPrimaryKeys (DatabaseMetaData meta, DBIdentifier catalog, DBIdentifier schemaName, DBIdentifier tableName, Connection conn) throws SQLException { if (tableName == null && !supportsNullTableForGetPrimaryKeys) return null; beforeMetadataOperation(conn); ResultSet pks = null; try { pks = meta.getPrimaryKeys(getCatalogNameForMetadata(catalog), getSchemaNameForMetadata(schemaName), getTableNameForMetadata(tableName)); List pkList = new ArrayList(); while (pks != null && pks.next()) pkList.add(newPrimaryKey(pks)); return (PrimaryKey[]) pkList.toArray (new PrimaryKey[pkList.size()]); } finally { if (pks != null) try { pks.close(); } catch (Exception e) { } } }
/** * Reflect on the schema to find primary keys for the given table pattern. */ protected PrimaryKey[] getPrimaryKeysFromGetPrimaryKeys (DatabaseMetaData meta, DBIdentifier catalog, DBIdentifier schemaName, DBIdentifier tableName, Connection conn) throws SQLException { if (tableName == null && !supportsNullTableForGetPrimaryKeys) return null; beforeMetadataOperation(conn); ResultSet pks = null; try { pks = meta.getPrimaryKeys(getCatalogNameForMetadata(catalog), getSchemaNameForMetadata(schemaName), getTableNameForMetadata(tableName)); List pkList = new ArrayList(); while (pks != null && pks.next()) pkList.add(newPrimaryKey(pks)); return (PrimaryKey[]) pkList.toArray (new PrimaryKey[pkList.size()]); } finally { if (pks != null) try { pks.close(); } catch (Exception e) { } } }
/** * Reflect on the schema to find indexes matching the given table pattern. */ public Index[] getIndexInfo(DatabaseMetaData meta, DBIdentifier catalog, DBIdentifier schemaName, DBIdentifier tableName, boolean unique, boolean approx, Connection conn) throws SQLException { if (tableName == null && !supportsNullTableForGetIndexInfo) return null; beforeMetadataOperation(conn); ResultSet indexes = null; try { indexes = meta.getIndexInfo(getCatalogNameForMetadata(catalog), getSchemaNameForMetadata(schemaName), getTableNameForMetadata(tableName), unique, approx); List indexList = new ArrayList(); while (indexes != null && indexes.next()) indexList.add(newIndex(indexes)); return (Index[]) indexList.toArray(new Index[indexList.size()]); } finally { if (indexes != null) try { indexes.close(); } catch (Exception e) { } } }
/** * Reflect on the schema to find primary keys for the given table pattern. */ protected PrimaryKey[] getPrimaryKeysFromGetPrimaryKeys (DatabaseMetaData meta, DBIdentifier catalog, DBIdentifier schemaName, DBIdentifier tableName, Connection conn) throws SQLException { if (tableName == null && !supportsNullTableForGetPrimaryKeys) return null; beforeMetadataOperation(conn); ResultSet pks = null; try { pks = meta.getPrimaryKeys(getCatalogNameForMetadata(catalog), getSchemaNameForMetadata(schemaName), getTableNameForMetadata(tableName)); List pkList = new ArrayList(); while (pks != null && pks.next()) pkList.add(newPrimaryKey(pks)); return (PrimaryKey[]) pkList.toArray (new PrimaryKey[pkList.size()]); } finally { if (pks != null) try { pks.close(); } catch (Exception e) { } } }
/** * Reflect on the schema to find primary keys for the given table pattern. */ protected PrimaryKey[] getPrimaryKeysFromGetPrimaryKeys (DatabaseMetaData meta, String catalog, String schemaName, String tableName, Connection conn) throws SQLException { if (tableName == null && !supportsNullTableForGetPrimaryKeys) return null; beforeMetadataOperation(conn); ResultSet pks = null; try { pks = meta.getPrimaryKeys(getCatalogNameForMetadata(catalog), getSchemaNameForMetadata(schemaName), getTableNameForMetadata(tableName)); List pkList = new ArrayList(); while (pks != null && pks.next()) pkList.add(newPrimaryKey(pks)); return (PrimaryKey[]) pkList.toArray (new PrimaryKey[pkList.size()]); } finally { if (pks != null) try { pks.close(); } catch (Exception e) { } } }
/** * Reflect on the schema to find indexes matching the given table pattern. */ public Index[] getIndexInfo(DatabaseMetaData meta, DBIdentifier catalog, DBIdentifier schemaName, DBIdentifier tableName, boolean unique, boolean approx, Connection conn) throws SQLException { if (tableName == null && !supportsNullTableForGetIndexInfo) return null; beforeMetadataOperation(conn); ResultSet indexes = null; try { indexes = meta.getIndexInfo(getCatalogNameForMetadata(catalog), getSchemaNameForMetadata(schemaName), getTableNameForMetadata(tableName), unique, approx); List indexList = new ArrayList(); while (indexes != null && indexes.next()) indexList.add(newIndex(indexes)); return (Index[]) indexList.toArray(new Index[indexList.size()]); } finally { if (indexes != null) try { indexes.close(); } catch (Exception e) { } } }
/** * Reflect on the schema to find primary keys for the given table pattern. */ protected PrimaryKey[] getPrimaryKeysFromGetPrimaryKeys (DatabaseMetaData meta, DBIdentifier catalog, DBIdentifier schemaName, DBIdentifier tableName, Connection conn) throws SQLException { if (tableName == null && !supportsNullTableForGetPrimaryKeys) return null; beforeMetadataOperation(conn); ResultSet pks = null; try { pks = meta.getPrimaryKeys(getCatalogNameForMetadata(catalog), getSchemaNameForMetadata(schemaName), getTableNameForMetadata(tableName)); List pkList = new ArrayList(); while (pks != null && pks.next()) pkList.add(newPrimaryKey(pks)); return (PrimaryKey[]) pkList.toArray (new PrimaryKey[pkList.size()]); } finally { if (pks != null) try { pks.close(); } catch (Exception e) { } } }
/** * Reflect on the schema to find tables matching the given name pattern. */ public Table[] getTables(DatabaseMetaData meta, String catalog, String schemaName, String tableName, Connection conn) throws SQLException { if (!supportsSchemaForGetTables) schemaName = null; else schemaName = getSchemaNameForMetadata(schemaName); String[] types = Strings.split(tableTypes, ",", 0); for (int i = 0; i < types.length; i++) types[i] = types[i].trim(); beforeMetadataOperation(conn); ResultSet tables = null; try { tables = meta.getTables(getCatalogNameForMetadata(catalog), schemaName, getTableNameForMetadata(tableName), types); List tableList = new ArrayList(); while (tables != null && tables.next()) tableList.add(newTable(tables)); return (Table[]) tableList.toArray(new Table[tableList.size()]); } finally { if (tables != null) try { tables.close(); } catch (Exception e) { } } }
return null; beforeMetadataOperation(conn); ResultSet pks = null; try {
/** * Reflect on the schema to return foreign keys imported by the given * table pattern. */ public ForeignKey[] getImportedKeys(DatabaseMetaData meta, String catalog, String schemaName, String tableName, Connection conn) throws SQLException { if (!supportsForeignKeys) return null; if (tableName == null && !supportsNullTableForGetImportedKeys) return null; beforeMetadataOperation(conn); ResultSet keys = null; try { keys = meta.getImportedKeys(getCatalogNameForMetadata(catalog), getSchemaNameForMetadata(schemaName), getTableNameForMetadata(tableName)); List importedKeyList = new ArrayList(); while (keys != null && keys.next()) importedKeyList.add(newForeignKey(keys)); return (ForeignKey[]) importedKeyList.toArray (new ForeignKey[importedKeyList.size()]); } finally { if (keys != null) try { keys.close(); } catch (Exception e) { } } }
types[i] = types[i].trim(); beforeMetadataOperation(conn); ResultSet tables = null; try {
types[i] = types[i].trim(); beforeMetadataOperation(conn); ResultSet tables = null; try {
types[i] = types[i].trim(); beforeMetadataOperation(conn); ResultSet tables = null; try {
sqlSchemaName = getSchemaNameForMetadata(schemaName); beforeMetadataOperation(conn); ResultSet cols = null; try {
return null; beforeMetadataOperation(conn); ResultSet pks = null; try {
return null; beforeMetadataOperation(conn); ResultSet pks = null; try {
return null; beforeMetadataOperation(conn); ResultSet pks = null; try {