private boolean fulfillsPlatformDependendMatches(ITableInfo iTableInfo, String catalog) { if(SQLDatabaseMetaData.DriverMatch.isComHttxDriver(_session.getSQLConnection())) { return ( iTableInfo.getCatalogName()==null && "\".\"".equals(catalog)); } else { return false; } }
private boolean fulfillsPlatformDependendMatches(ITableInfo iTableInfo, String catalog) { if(SQLDatabaseMetaData.DriverMatch.isComHttxDriver(_session.getSQLConnection())) { return ( iTableInfo.getCatalogName()==null && "\".\"".equals(catalog)); } else { return false; } }
public String getCatalogName() { if (null != _objectTreeNode) { return _objectTreeNode.getDatabaseObjectInfo().getCatalogName(); } else { return _tableInfo.getCatalogName(); } }
/** * * @param columnList * @param ti * @return * @throws SQLException */ public static String getSelectQuery(SessionInfoProvider prov, String columnList, ITableInfo ti) throws SQLException, UserCancelledOperationException { StringBuilder result = new StringBuilder("select "); result.append(columnList); result.append(" from "); ISession sourceSession = prov.getSourceSession(); String tableName = getQualifiedObjectName( sourceSession, ti.getCatalogName(), ti.getSchemaName(), ti.getSimpleName(), DialectFactory.SOURCE_TYPE); result.append(tableName); return result.toString(); }
public void execute() { StringBuffer sqlBuffer = new StringBuffer(); final String sqlSep = _session.getQueryTokenizer().getSQLStatementSeparator(); sqlBuffer.append("DBCC INDEXDEFRAG("); sqlBuffer.append(_tableInfo.getCatalogName()); sqlBuffer.append(","); sqlBuffer.append(_tableInfo.getSimpleName()); sqlBuffer.append(","); sqlBuffer.append(_indexName); sqlBuffer.append(")\n"); sqlBuffer.append(sqlSep); sqlBuffer.append(" \n"); _session.getSessionInternalFrame().getSQLPanelAPI().appendSQLScript(sqlBuffer.toString(), true); _session.getSessionInternalFrame().getSQLPanelAPI().executeCurrentSQL(); _session.selectMainTab(ISession.IMainPanelTabIndexes.SQL_TAB); } }
public static boolean tableHasPrimaryKey(ISQLConnection con, ITableInfo ti) throws SQLException { boolean result = false; ResultSet rs = null; try { DatabaseMetaData md = con.getConnection().getMetaData(); String cat = ti.getCatalogName(); String schema = ti.getSchemaName(); String tableName = ti.getSimpleName(); rs = md.getPrimaryKeys(cat, schema, tableName); if (rs.next()) { result = true; } } finally { SQLUtilities.closeResultSet(rs); } return result; }
public void execute() { StringBuffer sqlBuffer = new StringBuffer(); final String sqlSep = _session.getQueryTokenizer().getSQLStatementSeparator(); sqlBuffer.append("DBCC SHOW_STATISTICS(["); sqlBuffer.append(_tableInfo.getCatalogName()); sqlBuffer.append("."); sqlBuffer.append(_tableInfo.getSchemaName()); sqlBuffer.append("."); sqlBuffer.append(_tableInfo.getSimpleName()); sqlBuffer.append("],"); sqlBuffer.append(_indexName); sqlBuffer.append(")\n"); sqlBuffer.append(sqlSep); sqlBuffer.append("\n"); _session.getSessionInternalFrame().getSQLPanelAPI().appendSQLScript(sqlBuffer.toString(), true); _session.getSessionInternalFrame().getSQLPanelAPI().executeCurrentSQL(); _session.selectMainTab(ISession.IMainPanelTabIndexes.SQL_TAB); } }
if (md.supportsCatalogsInTableDefinitions()) rs = md.getPrimaryKeys(ti.getCatalogName(), null, ti.getSimpleName()); } else if (md.supportsSchemasInTableDefinitions())
catalogTF.setPreferredSize(mediumField); catalogTF.setEditable(false); catalogTF.setText(tableInfos[0].getCatalogName()); pane.add(catalogTF, getFieldConstraints(c));
private void onTablesDropped(List<ITableInfo> tis, Point dropPoint) { Positioner positioner = new Positioner(dropPoint); for (ITableInfo ti : tis) { addTableIntern(positioner, ti.getSimpleName(), ti.getSchemaName(), ti.getCatalogName(), null); } }
boolean matches = matchesMetaString(ti.getCatalogName(), catalogName); matches &= matchesMetaString(ti.getSchemaName(), schemaName); matches &= matchesMetaString(ti.getSimpleName(), simpleName);
if (null != tables[i].getCatalogName() && 0 < tables[i].getCatalogName().length()) nameWithSchemaAndCatalog = tables[i].getCatalogName().toUpperCase() + "." + nameWithSchema;
if (null != tables[i].getCatalogName() && 0 < tables[i].getCatalogName().length()) nameWithSchemaAndCatalog = tables[i].getCatalogName().toUpperCase() + "." + nameWithSchema;
false == catalog.equalsIgnoreCase(iTableInfo.getCatalogName()) && false == fulfillsPlatformDependendMatches(iTableInfo, catalog)
boolean matches = matchesMetaString(ti.getCatalogName(), catalogName); matches &= matchesMetaString(ti.getSchemaName(), schemaName); matches &= matchesMetaString(ti.getSimpleName(), simpleName);
false == catalog.equalsIgnoreCase(iTableInfo.getCatalogName()) && false == fulfillsPlatformDependendMatches(iTableInfo, catalog)
ti.getCatalogName(), ti.getSchemaName(), ti.getSimpleName(),
String catalog = selectedTable.getCatalogName(); ITableInfo[] tables = _session.getSchemaInfo().getITableInfos(catalog, schema);
private void showCustomDialog() throws SQLException { ITableInfo selectedTable = (ITableInfo) _info[0]; ITableInfo[] tables = _session.getSchemaInfo().getITableInfos(selectedTable.getCatalogName(), selectedTable.getSchemaName()); TableColumnInfo[] tableColumnInfos = _session.getMetaData().getColumnInfo(selectedTable); _allTables = new HashMap<String, TableColumnInfo[]>(); for (ITableInfo table : tables) { TableColumnInfo[] columns = safeGetColumns(table); if (table.getDatabaseObjectType() == DatabaseObjectType.TABLE && table != selectedTable && columns != null) { _allTables.put(table.getSimpleName(), columns); } } customDialog = dialogFactory.createDialog(selectedTable.getSimpleName(), tableColumnInfos, _allTables); customDialog.addExecuteListener(new ExecuteListener()); customDialog.addEditSQLListener(new EditSQLListener(customDialog)); customDialog.addShowSQLListener(new ShowSQLListener(i18n.SHOWSQL_DIALOG_TITLE, customDialog)); customDialog.setLocationRelativeTo(SessionUtils.getOwningFrame(_session)); customDialog.setVisible(true); }
_schemaInfoCache.clearTables(ti.getCatalogName(), ti.getSchemaName(), ti.getSimpleName(), types); loadTables(ti.getCatalogName(), ti.getSchemaName(), ti.getSimpleName(), types, 1);