Examples of ITableInfo


Examples of net.sourceforge.squirrel_sql.fw.sql.ITableInfo

        {
           if (false == dbObjs[k] instanceof ITableInfo)
           {
              continue;
           }
           ITableInfo ti = (ITableInfo) dbObjs[k];

           sbScript.append("SELECT ");

           TableColumnInfo[] infos = conn.getSQLMetaData().getColumnInfo(ti);
           for (int i = 0; i < infos.length; i++)
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.ITableInfo

    boolean isMQT = false;

    if (doi.getDatabaseObjectType() == DatabaseObjectType.TABLE)
    {
      ITableInfo info = (ITableInfo) doi;
      if (info.getType().startsWith("MATERIALIZED"))
      {
        isMQT = true;
        if (s_log.isDebugEnabled())
        {
          s_log.debug("Table " + doi.getSimpleName() + " appears to be an MQT");
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.ITableInfo

      else
      {
        cb.setLoadingPrefix(i18n.DROPPING_TABLE_PREFIX);
        if (tableCount < DropTablesCommand.this.orderedTables.size())
        {
          final ITableInfo ti = DropTablesCommand.this.orderedTables.get(tableCount);
          cb.currentlyLoading(ti.getSimpleName());
        }
        tableCount++;
      }
    }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.ITableInfo

    return result;
  }

  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(_session.getApplication().getMainFrame());
    customDialog.setVisible(true);
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.ITableInfo

  {
    if (!(_info[0] instanceof ITableInfo))
    {
      return;
    }
    ITableInfo ti = (ITableInfo) _info[0];
    PrimaryKeyCommandUtility pkcUtil = new PrimaryKeyCommandUtility(super._session, _info);
    if (!pkcUtil.tableHasPrimaryKey())
    {
      _session.showErrorMessage(s_stringMgr.getString("DropPrimaryKeyCommand.noKeyToDrop",
        ti.getSimpleName()));
    } else
    {
      showCustomDialog();
    }
  }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.ITableInfo

  /**
   * @throws SQLException
   */
  private void showCustomDialog() throws SQLException
  {
    ITableInfo ti = (ITableInfo) _info[0];
    TableColumnInfo[] columns = getPkTableColumns(ti);

    // Show the user a dialog with a list of columns and ask them to select
    customDialog = new ColumnListDialog(columns, ColumnListDialog.DROP_PRIMARY_KEY_MODE);
    customDialog.addColumnSelectionListener(new ExecuteListener());
    customDialog.addEditSQLListener(new EditSQLListener(customDialog));
    customDialog.addShowSQLListener(new ShowSQLListener(i18n.SHOWSQL_DIALOG_TITLE, customDialog));
    customDialog.setLocationRelativeTo(_session.getApplication().getMainFrame());
    customDialog.setMultiSelection();
    customDialog.setTableName(ti.getQualifiedName());

    SQLDatabaseMetaData md = _session.getSQLConnection().getSQLMetaData();
    PrimaryKeyInfo[] infos = md.getPrimaryKey(ti);
    String pkName = infos[0].getSimpleName();
    customDialog.setPrimaryKeyName(pkName);
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.ITableInfo

    }


    @Override
    protected void onExecute() throws SQLException {
        ITableInfo ti = (ITableInfo) _info[0];
        List<IndexInfo> indexes = _session.getSQLConnection().getSQLMetaData().getIndexInfo(ti);
        List<IndexInfo> uniqueIndexes = new ArrayList<IndexInfo>();
        for (IndexInfo index : indexes) {
            if (!index.isNonUnique()) {
                uniqueIndexes.add(index);
            }
        }
        if (uniqueIndexes.size() == 0) {
            _session.showErrorMessage(s_stringMgr.getString("DropUniqueConstraintCommand.noUniqueConstraintonTable",
                    ti.getSimpleName()));
        } else if (uniqueIndexes.size() == 1) {
            _dropIndexInfo = new IndexInfo[]{uniqueIndexes.get(0)};
            showCustomDialog();
        } else {
            listDialog = new DefaultListDialog(indexes.toArray(new IndexInfo[]{}), ti.getSimpleName(), DefaultListDialog.DIALOG_TYPE_UNIQUE_CONSTRAINTS);
            listDialog.addColumnSelectionListener(new ColumnListSelectionActionListener());
            listDialog.setLocationRelativeTo(_session.getApplication().getMainFrame());
            listDialog.setVisible(true);
        }
    }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.ITableInfo

        pbMain.setValue(0);
        pbMain.setMaximum(tableInfoArray.length);

        for (int iTableInfo = 0; iTableInfo < tableInfoArray.length; iTableInfo++)
        {
          ITableInfo tableInfo = tableInfoArray[iTableInfo];
          pbMain.setString(tableInfo.getSimpleName() + " " + (iTableInfo + 1) + "/"
                + pbMain.getMaximum());

          if (!checkIndices(tableInfo))
          {
            error = true;
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.ITableInfo

                  for (int k = 0; k < dbObjs.length; k++)
                  {
                     if (dbObjs[k] instanceof ITableInfo)
                     {
                        if (_abortController.isStop()) break;
                        ITableInfo ti = (ITableInfo) dbObjs[k];
                        String sTable = ScriptUtil.getTableName(ti);
                        StringBuilder sql = new StringBuilder();
                        sql.append("select * from ");
                        sql.append(DialectUtils.formatQualified(ti.getSimpleName(), ti.getSchemaName(), qualifyTableNames, useDoubleQuotes));
                       
                        // Some databases cannot order by LONG/LOB columns.
                        if (!JDBCTypeMapper.isLongType(getFirstColumnType(ti)))
                        {
                            sql.append(" order by ");
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.ITableInfo

            for (int k = 0; k < dbObjs.length; k++) {
                if (false == dbObjs[k] instanceof ITableInfo) {
                    continue;

                }
                ITableInfo ti = (ITableInfo) dbObjs[k];

                String sTable = ScriptUtil.getTableName(ti);
                sbScript.append("DROP TABLE ");
                sbScript.append(sTable);
                sbScript.append(ScriptUtil.getStatementSeparator(_session));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.