boolean isDefault = defaultSchemaName == null || defaultSchemaName.equals(schemaName); DbSchema schema = new DbSchema(this, schemaName, isDefault); if (isDefault) { defaultSchema = schema; String[] tableTypes = { "TABLE", "SYSTEM TABLE", "VIEW", "SYSTEM VIEW", "TABLE LINK", "SYNONYM", "EXTERNAL" }; schema.readTables(meta, tableTypes); if (!isPostgreSQL && !isDB2) { schema.readProcedures(meta);
public DbTableOrView(DbSchema schema, ResultSet rs) throws SQLException { this.schema = schema; name = rs.getString("TABLE_NAME"); String type = rs.getString("TABLE_TYPE"); isView = "VIEW".equals(type); quotedName = schema.getContents().quoteIdentifier(name); }
for (DbProcedure procedure : schema.getProcedures()) { final String procName = procedure.getName(); if (procName.startsWith(incompleteFunctionName)) {
String indentation = ", " + level + ", " + (showColumns ? "1" : "2") + ", "; String indentNode = ", " + (level + 1) + ", 2, "; DbTableOrView[] tables = schema.getTables(); if (tables == null) { return treeIndex; boolean isOracle = schema.getContents().isOracle(); boolean notManyTables = tables.length < SysProperties.CONSOLE_MAX_TABLES_LIST_INDEXES; for (DbTableOrView table : tables) { tables = schema.getTables(); for (DbTableOrView view : tables) { if (!view.isView()) { treeIndex = addColumns(mainSchema, view, buff, treeIndex, notManyTables, columnsBuffer); if (schema.getContents().isH2()) {
String indentation = ", " + level + ", " + (showColumns ? "1" : "2") + ", "; String indentNode = ", " + (level + 1) + ", 2, "; DbTableOrView[] tables = schema.getTables(); if (tables == null) { return treeIndex; boolean isOracle = schema.getContents().isOracle(); boolean notManyTables = tables.length < SysProperties.CONSOLE_MAX_TABLES_LIST_INDEXES; for (DbTableOrView table : tables) { tables = schema.getTables(); for (DbTableOrView view : tables) { if (!view.isView()) { treeIndex = addColumns(mainSchema, view, buff, treeIndex, notManyTables, columnsBuffer); if (schema.getContents().isH2()) {
boolean isDefault = defaultSchemaName == null || defaultSchemaName.equals(schemaName); DbSchema schema = new DbSchema(this, schemaName, isDefault); if (isDefault) { defaultSchema = schema; String[] tableTypes = { "TABLE", "SYSTEM TABLE", "VIEW", "SYSTEM VIEW", "TABLE LINK", "SYNONYM", "EXTERNAL" }; schema.readTables(meta, tableTypes); if (!isPostgreSQL && !isDB2) { schema.readProcedures(meta);
public DbProcedure(DbSchema schema, ResultSet rs) throws SQLException { this.schema = schema; name = rs.getString("PROCEDURE_NAME"); returnsResult = rs.getShort("PROCEDURE_TYPE") == DatabaseMetaData.procedureReturnsResult; quotedName = schema.getContents().quoteIdentifier(name); }
String indentation = ", " + level + ", " + (showColumns ? "1" : "2") + ", "; String indentNode = ", " + (level + 1) + ", 2, "; DbTableOrView[] tables = schema.getTables(); if (tables == null) { return treeIndex; boolean isOracle = schema.getContents().isOracle(); boolean notManyTables = tables.length < SysProperties.CONSOLE_MAX_TABLES_LIST_INDEXES; for (DbTableOrView table : tables) { tables = schema.getTables(); for (DbTableOrView view : tables) { if (!view.isView()) { treeIndex = addColumns(mainSchema, view, buff, treeIndex, notManyTables, columnsBuffer); if (schema.getContents().isH2()) { PreparedStatement prep = null; try {
for (DbProcedure procedure : schema.getProcedures()) { final String procName = procedure.getName(); if (procName.startsWith(incompleteFunctionName)) {
boolean isDefault = defaultSchemaName == null || defaultSchemaName.equals(schemaName); DbSchema schema = new DbSchema(this, schemaName, isDefault); if (isDefault) { defaultSchema = schema; String[] tableTypes = { "TABLE", "SYSTEM TABLE", "VIEW", "SYSTEM VIEW", "TABLE LINK", "SYNONYM", "EXTERNAL" }; schema.readTables(meta, tableTypes); if (!isPostgreSQL && !isDB2) { schema.readProcedures(meta);
/** * Read the column for this table from the database meta data. * * @param meta the database meta data */ public void readColumns(DatabaseMetaData meta) throws SQLException { ResultSet rs = meta.getColumns(null, schema.name, name, null); ArrayList<DbColumn> list = New.arrayList(); while (rs.next()) { DbColumn column = DbColumn.getColumn(schema.getContents(), rs); list.add(column); } rs.close(); columns = list.toArray(new DbColumn[0]); }
for (DbProcedure procedure : schema.getProcedures()) { final String procName = procedure.getName(); if (procName.startsWith(incompleteFunctionName)) {
/** * Read the column for this table from the database meta data. * * @param meta the database meta data */ void readParameters(DatabaseMetaData meta) throws SQLException { ResultSet rs = meta.getProcedureColumns(null, schema.name, name, null); ArrayList<DbColumn> list = New.arrayList(); while (rs.next()) { DbColumn column = DbColumn.getProcedureColumn(schema.getContents(), rs); if (column.getPosition() > 0) { // Not the return type list.add(column); } } rs.close(); parameters = new DbColumn[list.size()]; // Store the parameter in the good position [1-n] for (int i = 0; i < parameters.length; i++) { DbColumn column = list.get(i); if (column.getPosition() > 0 && column.getPosition() <= parameters.length) { parameters[column.getPosition() - 1] = column; } } }
public DbProcedure(DbSchema schema, ResultSet rs) throws SQLException { this.schema = schema; name = rs.getString("PROCEDURE_NAME"); returnsResult = rs.getShort("PROCEDURE_TYPE") == DatabaseMetaData.procedureReturnsResult; quotedName = schema.getContents().quoteIdentifier(name); }
public DbProcedure(DbSchema schema, ResultSet rs) throws SQLException { this.schema = schema; name = rs.getString("PROCEDURE_NAME"); returnsResult = rs.getShort("PROCEDURE_TYPE") == DatabaseMetaData.procedureReturnsResult; quotedName = schema.getContents().quoteIdentifier(name); }
public DbTableOrView(DbSchema schema, ResultSet rs) throws SQLException { this.schema = schema; name = rs.getString("TABLE_NAME"); String type = rs.getString("TABLE_TYPE"); isView = "VIEW".equals(type); quotedName = schema.getContents().quoteIdentifier(name); }
public DbTableOrView(DbSchema schema, ResultSet rs) throws SQLException { this.schema = schema; name = rs.getString("TABLE_NAME"); String type = rs.getString("TABLE_TYPE"); isView = "VIEW".equals(type); quotedName = schema.getContents().quoteIdentifier(name); }