Examples of ISQLDatabaseMetaData


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

   }

   public static ISQLDatabaseMetaData getEasyMockSybase12SQLMetaData()
         throws SQLException
   {
      ISQLDatabaseMetaData md = getSybaseSQLMetaData();
      String version =
         "Adaptive Server Enterprise/12.5.4/EBF 13194 " +
         "EC ESD/P/Linux Intel/Linux 2.4.21-20.ELsmp i686/" +
         "ase120/2179/32-bit/FBO/Mon Feb  6 04:14:19 2006";
      expect(md.getDatabaseProductVersion()).andReturn(version).anyTimes();
      expect(md.supportsSchemasInTableDefinitions()).andStubReturn(true);
      replay(md);
      return md;
   }
View Full Code Here

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

      replay(md);
      return md;
   }

   private static ISQLDatabaseMetaData getSybaseSQLMetaData() throws SQLException {
      ISQLDatabaseMetaData md = createMock(ISQLDatabaseMetaData.class);
      expect(md.getDatabaseProductName()).andReturn("Adaptive Server Enterprise")
                                         .anyTimes();
      expect(md.supportsSchemasInDataManipulation()).andReturn(true).anyTimes();
      expect(md.supportsCatalogsInDataManipulation()).andReturn(true)
                                                     .anyTimes();
      expect(md.getCatalogSeparator()).andReturn(".").anyTimes();
      expect(md.getIdentifierQuoteString()).andReturn("\"").anyTimes();
      expect(md.getURL()).andReturn("jdbc:sybase:Tds:192.168.1.135:4115/dbcopydest")
                         .anyTimes();
      return md;     
   }
View Full Code Here

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

public class ColumnDiffDialogTestUI {

    public static void main(String[] args) throws Exception {
        ApplicationArguments.initialize(new String[] {});
       
        ISQLDatabaseMetaData md = FwTestUtil.getEasyMockSQLMetaData("oracle", "jdbc:oracle");
        ColumnDifference diff = new ColumnDifference();
        TableColumnInfo column1 = FwTestUtil.getBigintColumnInfo(md, true);
        TableColumnInfo column2 = FwTestUtil.getVarcharColumnInfo(md, true, 100);
        diff.setColumns(column1, column2);
        diff.execute();
View Full Code Here

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

       return createTableScriptString(new IDatabaseObjectInfo[] { dbObj });
   }

   public String createTableScriptString(IDatabaseObjectInfo[] dbObjs) {
        StringBuilder result = new StringBuilder(1000);
        ISQLDatabaseMetaData md = _session.getMetaData();
        try {
            boolean isJdbcOdbc = md.getURL().startsWith("jdbc:odbc:");
            if (isJdbcOdbc) {
                _session.showErrorMessage(i18n.JDBCODBC_MESSAGE);
                s_log.error(i18n.JDBCODBC_MESSAGE);
            }
View Full Code Here

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

     *            unexpected sql exception
     */
    private boolean isColumnNameUnique(String columnName) throws SQLException
    {
      boolean result = true;
      ISQLDatabaseMetaData md = _session.getMetaData();
      TableColumnInfo[] columnInfos = md.getColumnInfo((ITableInfo) _info[0]);
      for (TableColumnInfo columnInfo : columnInfos)
      {
        String existingColumnName = columnInfo.getColumnName();
        if (columnName.equalsIgnoreCase(existingColumnName))
        {
View Full Code Here

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

  @Override
  protected String[] generateSQLStatements() throws Exception
  {
    ArrayList<String> results = new ArrayList<String>();

    ISQLDatabaseMetaData md = _session.getMetaData();

    String catalog = _info[0].getCatalogName();
    String schema = _info[0].getSchemaName();

    String lookupTableName = _customDialog.getLookupTableName();
    String lookupPrimaryKey = _customDialog.getLookupPrimaryKey();

    TableColumnInfo sourceColumn = null;
    for (TableColumnInfo info : md.getColumnInfo((ITableInfo) _info[0]))
    {
      if (info.getColumnName().equals(_customDialog.getSourceColumn()))
      {
        sourceColumn = info;
        break;
View Full Code Here

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

    return result;
  }

  private void showCustomDialog() throws SQLException
  {
    ISQLDatabaseMetaData md = _session.getMetaData();
    ITableInfo selectedTable = (ITableInfo) _info[0];
    TableColumnInfo[] tableColumnInfos = md.getColumnInfo(selectedTable);
    ForeignKeyInfo[] exportedKeys = md.getExportedKeysInfo(selectedTable);
    ForeignKeyInfo[] importedKeys = md.getImportedKeysInfo(selectedTable);

    _customDialog =
      new AddLookupTableDialog(selectedTable.getSimpleName(), getColumnNames(tableColumnInfos,
        exportedKeys,
        importedKeys));
View Full Code Here

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

    {
      catalog = fixCase(session, catalogName);
      schema = fixCase(session, schemaName);
      object = fixCase(session, objectName);
    }
    ISQLDatabaseMetaData md = session.getMetaData();
    boolean useSchema = true;
    boolean useCatalog = true;
    try
    {
      useCatalog = md.supportsCatalogsInTableDefinitions();
    } catch (SQLException e)
    {
      log.info("Encountered unexpected exception while attempting to "
            + "determine if catalogs are used in table definitions");
    }
    try
    {
      useSchema = md.supportsSchemasInTableDefinitions();
    } catch (SQLException e)
    {
      log.info("Encountered unexpected exception while attempting to "
            + "determine if schemas are used in table definitions");
    }
View Full Code Here

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

  public static String getCatSep(ISession session)
  {
    String catsep = ".";
    try
    {
      ISQLDatabaseMetaData md = session.getMetaData();
      catsep = md.getCatalogSeparator();
    } catch (SQLException e)
    {
      log.error("getCatSep: Unexpected Exception - " + e.getMessage(), e);
    }
    return catsep;
View Full Code Here

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

        return rs;
    }
   
    private void testBigintColType(String fromDb, String toDb) throws Exception
    {
        ISQLDatabaseMetaData md = FwTestUtil.getEasyMockSQLMetaData(fromDb, null);
        TableColumnInfo column = FwTestUtil.getBigintColumnInfo(md, true);
        testColType(md, toDb, column);
    }   
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.