Examples of ITableInfo


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

   private void checkSortOrder() {
      List<ITableInfo> tis = schemaInfoCacheUnderTest
            .getITableInfosForReadOnly();

      ITableInfo last = null;
      for (ITableInfo iTableInfo : tis) {
         if (last == null) {
            last = iTableInfo;
         } else {
            String prev = last.getSimpleName();
            String curr = iTableInfo.getSimpleName();
            System.out.println("prev: "+prev+" curr:"+curr);
            if (prev.compareTo(curr) > 0) {
               fail("Table named "+prev+" appeared before "+curr+" in the sorted list");
            }
View Full Code Here

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

      return result;
   }

   public static ITableInfo getEasyMockTableInfo(String catalog, String schema,
         String simpleName, String qualName) {
      ITableInfo result = EasyMock.createMock(ITableInfo.class);
      expect(result.getCatalogName()).andReturn(catalog).anyTimes();
      expect(result.getSchemaName()).andReturn(schema).anyTimes();
      expect(result.getSimpleName()).andReturn(simpleName).anyTimes();
      expect(result.getQualifiedName()).andReturn(qualName).anyTimes();
      replay(result);
      return result;
   }
View Full Code Here

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

      }
      return;
    }
    try
    {
      final ITableInfo ti = getTableInfo(session, tableName);
      if (ti == null)
      {
        System.out.println("Table " + tableName + " couldn't be dropped - doesn't exist");
        return;
      }
View Full Code Here

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

    runSQL(session, createMatViewSQL);
    final MockSession msession = (MockSession) session;
    final String cat = msession.getDefaultCatalog();
    final String schema = msession.getDefaultSchema();
    final SQLDatabaseMetaData md = session.getSQLConnection().getSQLMetaData();
    final ITableInfo info = new TableInfo(cat, schema, testMaterializedViewName, "TABLE", "", md);
    final List<String> dropSQL = dialect.getTableDropSQL(info, true, true, qualifier, prefs);
    runSQL(session, dropSQL);
  }
View Full Code Here

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

    catch (final SQLException e)
    {
      // Do nothing
    }

    ITableInfo ti = null;
    if (infos != null && infos.length > 0)
    {
      ti = infos[0];
    }
    else
View Full Code Here

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

    final String createSql = "create table " + testDefaultTableName + " ( mycol integer default 0 )";

    runSQL(session, createSql);

    /* Build the sql statement(s) to create the table */
    ITableInfo tableInfo = getTableInfo(session, testDefaultTableName);
    if (tableInfo == null)
    {
      tableInfo = getTableInfo(session, testDefaultTableName.toLowerCase());
    }
    if (tableInfo == null)
View Full Code Here

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

  
   private List<ITableInfo> convertArrayToList(IDatabaseObjectInfo[] dbObjs) {
       List<ITableInfo> result = new ArrayList<ITableInfo>();
       for (IDatabaseObjectInfo dbObj : dbObjs) {
           if (dbObj instanceof ITableInfo) {
               ITableInfo ti = (ITableInfo)dbObj;
               result.add(ti);
           }
       }
       return result;
   }
View Full Code Here

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

        if (dbObjs[0].getDatabaseObjectType() != DatabaseObjectType.TABLE) {
            s_log.error("iterateIndexes: selected item isn't a table");
            return;
        }
       
        ITableInfo tableInfo = (ITableInfo) dbObjs[0];
       
        ISQLConnection conn = _session.getSQLConnection();
        SQLDatabaseMetaData metaData = conn.getSQLMetaData();
       
        try {
            ResultSetDataSet rsds =
                metaData.getIndexInfo(tableInfo, indexColumnIndices, false);
            String indexName = "";
            while (rsds.next(null)) {
                String thisIndexName = (String)rsds.get(0);
                if (thisIndexName != null) {
                    if (!indexName.equals(thisIndexName)) {
                        listener.indexSpotted(tableInfo,thisIndexName);
                        indexName = thisIndexName;
                    }
                }               
            }
        }
        catch (DataSetException ex) {
            s_log.error("Unable to show indices for table "+
                        tableInfo.getSimpleName(), ex);
            // fine, don't show any indexes.
      //throw new WrappedSQLException(ex);
        }
    }
View Full Code Here

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

      Vector ret = new Vector();
      for (int i = 0; i < dbObjs.length; i++)
      {
         if (dbObjs[i] instanceof ITableInfo)
         {
            ITableInfo ti = (ITableInfo) dbObjs[i];
            String sTable = ti.getSchemaName() + "." +  ti.getSimpleName();
            ret.add(sTable);
         }
      }
      return (String[]) ret.toArray(new String[0]);
   }
View Full Code Here

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

    showCustomDialog();
  }

  protected void showCustomDialog() throws SQLException
  {
    ITableInfo selectedTable = (ITableInfo) _info[0];
    TableColumnInfo[] tableColumnInfos = _session.getMetaData().getColumnInfo(selectedTable);
   
    TreeSet<String> localColumns = new TreeSet<String>();
    for (TableColumnInfo column : tableColumnInfos)
    {
      // A Map for quick lookup later - we want to pass TableColumnInfos to the dialect, not merely column
      // names.
      columnMap.put(column.getColumnName(), column);
     
      // Add column name to the list
      localColumns.add(column.getColumnName());
    }

    customDialog =
      new AddUniqueConstraintDialog(selectedTable.getSimpleName(), localColumns.toArray(new String[] {}));
    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
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.