Examples of SQLDatabaseMetaData


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

   * Create the <TT>IDataSet</TT> to be displayed in this tab.
   */
  protected IDataSet createDataSet() throws DataSetException
  {
    final ISQLConnection conn = getSession().getSQLConnection();
        SQLDatabaseMetaData md = conn.getSQLMetaData();
        return md.getColumns(getTableInfo(), columnIndices, true);
  }
View Full Code Here

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

      final ISession session = _session;
      final ISQLConnection conn = session.getSQLConnection();

      try
      {
         SQLDatabaseMetaData md = conn.getSQLMetaData();
         TableColumnInfo[] infos = md.getColumnInfo(ti);
        
         // read the DB MetaData info and fill in the value, if any
         // Note that the ResultSet info and the colDefs should be
         // in the same order, but we cannot guarantee that.
         int expectedColDefIndex = 0;
View Full Code Here

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

    throws SQLException
  {
    final List<ObjectTreeNode> childNodes = new ArrayList<ObjectTreeNode>();
    final IDatabaseObjectInfo parentDbinfo = parentNode.getDatabaseObjectInfo();
    final ISQLConnection conn = session.getSQLConnection();
    final SQLDatabaseMetaData md = session.getSQLConnection().getSQLMetaData();
    final String catalogName = parentDbinfo.getCatalogName();
    final String schemaName = parentDbinfo.getSchemaName();
    final ObjFilterMatcher filterMatcher = new ObjFilterMatcher(session.getProperties());

    final String sequenceParentQuerySql = extractor.getSequenceParentQuery();
View Full Code Here

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

        // Since 1.4 implements interfaces that became available in JDBC 3.0,
        // let's warn the user if the driver doesn't support DatabaseMetaData
        // methods that were added in JDBC 2.1 and JDBC 3.0 specifications.

        SQLDatabaseMetaData md = _conn.getSQLMetaData();
        try {
            md.supportsResultSetType(ResultSet.TYPE_FORWARD_ONLY);
        } catch (Throwable e) {
            driverIs21Compliant = false;
        }

        if (!driverIs21Compliant) {
            // i18n[Session.driverCompliance=The driver being used for alias ''{0}'' is not JDBC 2.1 compliant.\nYou should consider getting a more recent version of this driver]
            String msg =
                s_stringMgr.getString("Session.driverCompliance", _alias.getName());
            // i18n[Session.driverComplianceTitle=JRE/JDBC Version Mismatch]
            String title =
                s_stringMgr.getString("Session.driverComplianceTitle");
            showMessageDialog(msg, title, JOptionPane.WARNING_MESSAGE);
            s_log.info(msg);
            return;
        }
        boolean driverIs30Compliant = true;
        try {
            md.supportsSavepoints();
        } catch (Throwable e) {
           if (s_log.isDebugEnabled()) {
             s_log.debug(e);
           }
            driverIs30Compliant = false;
View Full Code Here

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

    final List<ObjectTreeNode> childNodes = new ArrayList<ObjectTreeNode>();
    final IDatabaseObjectInfo parentDbinfo = parentNode.getDatabaseObjectInfo();
    final IDatabaseObjectInfo tableInfo = ((IndexParentInfo) parentDbinfo).getTableInfo();

    final ISQLConnection conn = session.getSQLConnection();
    final SQLDatabaseMetaData md = session.getSQLConnection().getSQLMetaData();
    PreparedStatement pstmt = null;
    ResultSet rs = null;
    try
    {
      String query = extractor.getTableIndexQuery();
View Full Code Here

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

         addDetailTab(DatabaseObjectType.SESSION, new MetaDataTab());
         addDetailTab(DatabaseObjectType.SESSION, new ConnectionStatusTab());

         try
         {
            SQLDatabaseMetaData md =
               _session.getSQLConnection().getSQLMetaData();
            if (md.supportsCatalogs())
            {
               _addDetailTab(DatabaseObjectType.SESSION, new CatalogsTab());
            }
         }
         catch (Throwable th)
         {
            s_log.error("Error in supportsCatalogs()", th);
         }

         try
         {
            SQLDatabaseMetaData md =
               _session.getSQLConnection().getSQLMetaData();
            if (md.supportsSchemas())
            {
               _addDetailTab(DatabaseObjectType.SESSION, new SchemasTab());
            }
         }
         catch (Throwable th)
View Full Code Here

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

  {
    if (conn == null)
    {
      throw new IllegalArgumentException("SQLConnection == null");
    }
    final SQLDatabaseMetaData md = conn.getSQLMetaData();
    if (md.supportsCatalogs())
    {
      final String[] catalogs = md.getCatalogs();
      if (catalogs != null)
      {
        setCatalogs(catalogs, conn.getCatalog());
      }
    }
View Full Code Here

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

    return "defaultSchema";
  }

  private ITableInfo getTableInfo(ISession session, String tableName) throws Exception
  {
    final SQLDatabaseMetaData md = session.getSQLConnection().getSQLMetaData();
    final String catalog = getDefaultCatalog(session);
    final String schema = getDefaultSchema(session);
    System.out.println("Looking for table with catalog=" + catalog + " schema=" + schema + " tableName="
      + tableName);
    ITableInfo[] infos = md.getTables(catalog, schema, tableName, TABLE_TYPES, null);
    if (infos.length == 0)
    {
      if (md.storesUpperCaseIdentifiers())
      {
        tableName = tableName.toUpperCase();
      }
      else
      {
        tableName = tableName.toLowerCase();
      }
      infos = md.getTables(catalog, schema, tableName, TABLE_TYPES, null);
      if (infos.length == 0) { return null; }
    }
    if (infos.length > 1) { throw new IllegalStateException("Found more than one table matching name="
      + tableName);
View Full Code Here

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

        + " WITH PRIMARY KEY AS SELECT * FROM TEST ";
    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.SQLDatabaseMetaData

    if (session.getSQLConnection().getSQLMetaData().storesUpperCaseIdentifiers())
    {
      tableName = tableName.toUpperCase();
    }

    final SQLDatabaseMetaData md = session.getSQLConnection().getSQLMetaData();
    final String catalog = getDefaultCatalog(session);
    final String schema = getDefaultSchema(session);

    ITableInfo[] infos = null;
    try
    {
      infos = md.getTables(catalog, schema, tableName, TABLE_TYPES, null);
    }
    catch (final SQLException e)
    {
      // Do nothing
    }
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.