Examples of SQLConnection


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

        session = createMock(ISession.class);
        tokenizer = createMock(IQueryTokenizer.class);
        md = createMock(ISQLDatabaseMetaData.class);
        con = createMock(Connection.class);
        driver = createMock(ISQLDriver.class);
        sqlCon = new SQLConnection(con, null, driver);
        session.setQueryTokenizer(tokenizer);
        expect(session.getMetaData()).andReturn(md);
        expect(session.getSQLConnection()).andReturn(sqlCon);
        expect(session.getQueryTokenizer()).andReturn(tokenizer);
        replay(session);
View Full Code Here

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

    System.out.println("Attempting to load class=" + className);
    Class.forName(className);
    System.out.println("Getting connection for url=" + jdbcUrl);
    Connection c = DriverManager.getConnection(jdbcUrl, u, p);
    initMockDriver(className, jdbcUrl);
    con = new SQLConnection(c, null, sqlDriver);
    init(false);
    sqlAlias.setUrl(jdbcUrl);
    sqlAlias.setUserName(u);
    sqlAlias.setPassword(p);
    sqlDriver.setDriverClassName(className);
View Full Code Here

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

  private void init(boolean initConnection)
  {
    if (initConnection)
    {
      // MockConnection2 mockCon = getMockConnection();
      con = new SQLConnection(getMockConnection(), null, sqlDriver);
    }
    id = new UidIdentifier();
    messageHandler = new MockMessageHandler();
    props = new SessionProperties();
    props.setLoadSchemasCatalogs(false);
View Full Code Here

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

      replay(tokenizer);
      return tokenizer;
   }

   public static SQLConnection getEasyMockSQLConnection() throws SQLException {
      SQLConnection result = createMock(SQLConnection.class);
      result.addPropertyChangeListener(EasyMock.isA(PropertyChangeListener.class));
      expect(result.getCatalog()).andReturn("TestCatalog").anyTimes();
      return result;
   }
View Full Code Here

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

      System.out.println("Attempting to load class="+className);
      Class.forName(className);
        System.out.println("Getting connection for url="+jdbcUrl);
      Connection c = DriverManager.getConnection(jdbcUrl, u, p);
      sqlDriver = new MockSQLDriver(className, jdbcUrl);
      con = new SQLConnection(c, null, sqlDriver);
      init(false);
        sqlAlias.setUrl(jdbcUrl);
        sqlAlias.setUserName(u);
        sqlAlias.setPassword(p);
        sqlDriver.setDriverClassName(className);
View Full Code Here

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

    }
   
    private void init(boolean initConnection) {
      if (initConnection) {
            //MockConnection2 mockCon = getMockConnection();
        con = new SQLConnection(getMockConnection(), null, sqlDriver);
      }
      id = new UidIdentifier();
      messageHandler = new MockMessageHandler();
      props = new SessionProperties();
      props.setLoadSchemasCatalogs(false);
View Full Code Here

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

     * Execute task. Connect to the alias with the information entered
     * in the connection internal frame.
     */
    public void run()
    {
      SQLConnection conn = null;
      final IIdentifier driverID = _alias.getDriverIdentifier();
      final ISQLDriver sqlDriver = _app.getDataCache().getDriver(driverID);

      try
      {
View Full Code Here

Examples of org.pentaho.platform.plugin.services.connections.sql.SQLConnection

    return result;
  }

  @Override
  protected boolean runQuery( final String rawQuery, final boolean live ) {
    SQLConnection conn = (SQLConnection) connection;
    return runSqlQuery( conn, rawQuery, live );
  }
View Full Code Here

Examples of org.pentaho.platform.plugin.services.connections.sql.SQLConnection

    }
  }

  protected SQLConnection getConnection( final String jndiName, final String driver, final String userId,
                                         final String password, final String connectionInfo ) {
    SQLConnection connection = null;
    try {
      if ( jndiName != null ) {
        connection =
          (SQLConnection) PentahoConnectionFactory.getConnection( IPentahoConnection.SQL_DATASOURCE, jndiName,
            getSession(), this );
View Full Code Here

Examples of org.pentaho.platform.plugin.services.connections.sql.SQLConnection

        error( Messages.getInstance().getErrorString( "SQLBaseComponent.ERROR_0007_NO_CONNECTION" ) ); //$NON-NLS-1$
        return false;
      }

      String query = applyInputsToFormat( rawQuery );
      SQLConnection sqlConnection = null;
      if ( ( connection instanceof SQLConnection ) ) {
        sqlConnection = (SQLConnection) connection;
      }
      // Some of the following Added by Arijit Chatterjee passing the timeout value to SQLConnection class
      if ( sqlConnection != null ) {
        if ( this.getQueryTimeout() >= 0 ) {
          sqlConnection.setQueryTimeout( this.getQueryTimeout() );
        }
        if ( this.getMaxRows() >= 0 ) {
          sqlConnection.setMaxRows( this.getMaxRows() );
        }
        if ( this.getReadOnly() ) {
          sqlConnection.setReadOnly( true );
        }
      }

      AbstractRelationalDbAction relationalDbAction = (AbstractRelationalDbAction) getActionDefinition();

      IPentahoResultSet resultSet = null;
      boolean isForwardOnly = relationalDbAction.getUseForwardOnlyResultSet().getBooleanValue( false );

      resultSet = doQuery( sqlConnection, query, isForwardOnly );

      if ( sqlConnection.isForcedForwardOnly() ) {
        isForwardOnly = true;
        live = false;
        warn( Messages.getInstance().getString( "SQLBaseComponent.WARN_FALL_BACK_TO_NONSCROLLABLE" ) ); //$NON-NLS-1$
      }
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.