Examples of ISQLConnection


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

    final List<File> files = new ArrayList<File>();
    final List<String> titles = new ArrayList<String>();
    synchronized (_session)
    {
      final ISQLConnection conn = _session.getSQLConnection();
      final SQLDatabaseMetaData md = conn.getSQLMetaData();

      // Dump session properties.
      try
      {
        files.add(createJavaBeanDumpFile(_session.getProperties()));
        titles.add("Session Properties");
      }
      catch (Throwable th)
      {
        final String msg = "Error dumping driver info";
        showErrorMessage(msg);
        showErrorMessage(th);
        s_log.error(msg, th);
      }
 
      // Dump driver information.
      try
      {
        files.add(createJavaBeanDumpFile(_session.getDriver()));
        titles.add("Driver");
      }
      catch (Throwable th)
      {
        final String msg = "Error dumping driver info";
                showErrorMessage(msg);
                showErrorMessage(th);
        s_log.error(msg, th);
      }
 
      // Dump alias information.
      try
      {
        files.add(createJavaBeanDumpFile(_session.getAlias()));
        titles.add("Alias");
      }
      catch (Throwable th)
      {
        final String msg = "Error dumping alias info";
        showErrorMessage(msg);
        showErrorMessage(th);
        s_log.error(msg, th);
      }
 
      // Dump general connection info.
      try
      {
        files.add(createGeneralConnectionDumpFile(conn));
        titles.add("Connection - General");
      }
      catch (Throwable th)
      {
        final String msg = "Error dumping general connection info";
        showErrorMessage(msg);
        showErrorMessage(th);
        s_log.error(msg, th);
      }
 
      // Dump meta data.
      try
      {
        File tempFile = File.createTempFile(PREFIX, SUFFIX);
        IDataSetViewer dest = new DataSetViewerTextFileDestination(tempFile);
        dest.show(conn.getSQLMetaData().getMetaDataSet());
        files.add(tempFile);
        titles.add("Metadata");
      }
      catch (Throwable th)
      {
        final String msg = "Error dumping metadata";
        showErrorMessage(msg);
        showErrorMessage(th);
        s_log.error(msg, th);
      }
 
      // Dump catalogs.
      try
      {
        File tempFile = File.createTempFile(PREFIX, SUFFIX);
        IDataSetViewer dest = new DataSetViewerTextFileDestination(tempFile);
        dest.show(new ObjectArrayDataSet(md.getCatalogs()));
        files.add(tempFile);
        titles.add("Catalogs");
      }
      catch (Throwable th)
      {
        final String msg = "Error dumping catalogs";
        showErrorMessage(msg);
        showErrorMessage(th);
        s_log.error(msg, th);
      }
 
      // Dump schemas.
      try
      {
        File tempFile = File.createTempFile(PREFIX, SUFFIX);
        IDataSetViewer dest = new DataSetViewerTextFileDestination(tempFile);
        dest.show(new ObjectArrayDataSet(_session.getSchemaInfo().getSchemas()));
        files.add(tempFile);
        titles.add("Schemas");
      }
      catch (Throwable th)
      {
        final String msg = "Error dumping schemas";
        showErrorMessage(msg);
        showErrorMessage(th);
        s_log.error(msg, th);
      }
 
      // Dump data types.
      try
      {
        File tempFile = File.createTempFile(PREFIX, SUFFIX);
        IDataSetViewer dest = new DataSetViewerTextFileDestination(tempFile);
        dest.show(conn.getSQLMetaData().getTypesDataSet());
        files.add(tempFile);
        titles.add("Data Types");
      }
      catch (Throwable th)
      {
View Full Code Here

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

  /**
   * Create the <TT>IDataSet</TT> to be displayed in this tab.
   */
  protected IDataSet createDataSet() throws DataSetException
  {
    final ISQLConnection conn = getSession().getSQLConnection();
        final SQLDatabaseMetaData dmd = conn.getSQLMetaData();
       
        ITableInfo ti = getTableInfo();
        if (! "TABLE".equalsIgnoreCase(ti.getType())) {
          // Frontbase describes it's tables as "BASE TABLE".
          if (!DialectFactory.isFrontBase(dmd)) {
View Full Code Here

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

   
    ISession mockSession = mockHelper.createMock(ISession.class);
    IApplication mockApplication = mockHelper.createMock(IApplication.class);
    IIdentifier mockIdentifier = mockHelper.createMock(IIdentifier.class);
    SessionManager mockSessionManager = mockHelper.createMock(SessionManager.class);
    ISQLConnection mockSqlConnection = mockHelper.createMock(ISQLConnection.class);
    SQLDatabaseMetaData mockMetaData = mockHelper.createMock(SQLDatabaseMetaData.class);
    IProcedureInfo mockProcedureInfo = mockHelper.createMock(IProcedureInfo.class);
   
    expect(mockSessionManager.getSession(mockIdentifier)).andStubReturn(mockSession);
    expect(mockSession.getApplication()).andStubReturn(mockApplication);
    expect(mockSession.getIdentifier()).andStubReturn(mockIdentifier);
    expect(mockApplication.getSessionManager()).andStubReturn(mockSessionManager);
    expect(mockSession.getSQLConnection()).andStubReturn(mockSqlConnection);
    expect(mockSqlConnection.getSQLMetaData()).andStubReturn(mockMetaData);
    expect(mockMetaData.getProcedureColumnsDataSet(mockProcedureInfo)).andStubReturn(null);
   
    mockHelper.replayAll();
    classUnderTest.setProcedureInfo(mockProcedureInfo);
    classUnderTest.setSession(mockSession);
View Full Code Here

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

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

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

   */
  protected IDataSet createDataSet() throws DataSetException
  {
    try
    {
      final ISQLConnection conn = getSession().getSQLConnection();
      final SQLDatabaseMetaData md = conn.getSQLMetaData();
      final ITableInfo ti = getTableInfo();
      final BestRowIdentifier[] bris = md.getBestRowIdentifier(ti);
      return new JavabeanArrayDataSet(AdapterFactory.getInstance().createBestRowIdentifierAdapter(bris));
    }
    catch (SQLException ex)
View Full Code Here

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

  /**
   * Create the <TT>IDataSet</TT> to be displayed in this tab.
   */
  protected IDataSet createDataSet() throws DataSetException
  {
    final ISQLConnection conn = getSession().getSQLConnection();
    try
    {
      final Statement stmt = conn.createStatement();
      try
      {
        final ResultSet rs = stmt.executeQuery("select count(*) from "
                        + getTableInfo().getQualifiedName());
        try
View Full Code Here

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

      long mstart = System.currentTimeMillis();
      long mfinish = 0;
     
      try
      {
         ISQLConnection conn = _session.getSQLConnection();
         _dmd = conn.getSQLMetaData();

         _dmd.clearCache();


         int progress = 0;
View Full Code Here

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

    * Create the <TT>IDataSet</TT> to be displayed in this tab.
    */
   protected IDataSet createDataSet() throws DataSetException
   {
      final ISession session = getSession();
      final ISQLConnection conn = session.getSQLConnection();
      ISQLDatabaseMetaData md = session.getMetaData();

     
      try
      {
         final Statement stmt = conn.createStatement();
         try
         {
            final SessionProperties props = session.getProperties();
            if (props.getContentsLimitRows())
            {
View Full Code Here

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

   */
  public List<ObjectTreeNode> createChildren(ISession session, ObjectTreeNode parentNode)
    throws SQLException
  {
    final IDatabaseObjectInfo parentDbinfo = parentNode.getDatabaseObjectInfo();
    final ISQLConnection conn = session.getSQLConnection();
    final SQLDatabaseMetaData md = conn.getSQLMetaData();

    boolean supportsCatalogs = false;
    try
    {
      supportsCatalogs = md.supportsCatalogs();
View Full Code Here

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

  {
    final List<ObjectTreeNode> list = new ArrayList<ObjectTreeNode>();

    if (session.getProperties().getLoadSchemasCatalogs())
    {
      final ISQLConnection conn = session.getSQLConnection();
      final SQLDatabaseMetaData md = conn.getSQLMetaData();

      // Add table types to list.
      if (_tableTypes.length > 0)
      {
        for (int i = 0; i < _tableTypes.length; ++i)
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.