public void applyLogin() {
    DatabaseLogin login = new DatabaseLogin();
    login.usePlatform(OracleDBPlatformHelper.getInstance().getOracle9Platform());
    login.setDriverClassName("oracle.jdbc.OracleDriver");
    login.setConnectionString("jdbc:oracle:thin:@tlsvrdb5.ca.oracle.com:TOPLINK");
    login.setUserName("qa9");
    login.setEncryptedPassword("BB742416276274A46959A54867978929");

    // Configuration Properties.

    setDatasourceLogin(login);
  }
  public void setup() {
    oldSession = getSession();
    DatabaseLogin login = (DatabaseLogin) oldSession.getLogin().clone();
    if (login.getConnector() instanceof JNDIConnector) {
      login.setConnector(new JNDIConnector("jdbc/OracleCoreAQ"));
    } else {
      login.setUserName("aquser");
      login.setPassword("aquser");
    }
    DatabaseSession session = new Project(login).createDatabaseSession();
    session.setSessionLog(getSession().getSessionLog());
    try {
      session.login();
    } catch (Exception exception) {
      throw new TestProblemException(
          "Database needs to be setup for AQ, with the aquser", exception);
    }

    /**
     * to setup aquser, need to execute, 1 - login as sys (default password is password) - login as
     * scott tiger connect sys/password@james as sysdba
     *
     * <p>2 - might need to install aq procesures? - in sqlplus
     * - @@<orahome>\ora92\rdbms\admin\catproc.sql
     *
     * <p>3 - create a aq user (i.e aquser) grant connect, resource , aq_administrator_role to
     * aquser identified by aquser grant execute on dbms_aq to aquser grant execute on dbms_aqadm to
     * aquser grant execute on dbms_lock to aquser connect aquser/aquser
     */
    try {
      session.executeNonSelectingCall(
          new SQLCall("begin DBMS_AQADM.STOP_QUEUE (queue_name => 'order_queue'); end;"));
    } catch (Exception notThere) {
    }
    try {
      session.executeNonSelectingCall(
          new SQLCall("begin DBMS_AQADM.DROP_QUEUE (queue_name => 'order_queue'); end;"));
    } catch (Exception notThere) {
    }
    try {
      session.executeNonSelectingCall(
          new SQLCall(
              "begin DBMS_AQADM.DROP_QUEUE_TABLE (queue_table => 'order_queue_table'); end;"));
    } catch (Exception notThere) {
    }
    try {
      session.executeNonSelectingCall(
          new SQLCall("begin DBMS_AQADM.STOP_QUEUE (queue_name => 'order_topic'); end;"));
    } catch (Exception notThere) {
    }
    try {
      session.executeNonSelectingCall(
          new SQLCall("begin DBMS_AQADM.DROP_QUEUE (queue_name => 'order_topic'); end;"));
    } catch (Exception notThere) {
    }
    try {
      session.executeNonSelectingCall(
          new SQLCall(
              "begin DBMS_AQADM.DROP_QUEUE_TABLE (queue_table => 'order_topic_table'); end;"));
    } catch (Exception notThere) {
    }
    try {
      session.executeNonSelectingCall(
          new SQLCall("begin DBMS_AQADM.STOP_QUEUE (queue_name => 'raw_order_queue'); end;"));
    } catch (Exception notThere) {
    }
    try {
      session.executeNonSelectingCall(
          new SQLCall("begin DBMS_AQADM.DROP_QUEUE (queue_name => 'raw_order_queue'); end;"));
    } catch (Exception notThere) {
    }
    try {
      session.executeNonSelectingCall(
          new SQLCall(
              "begin DBMS_AQADM.DROP_QUEUE_TABLE (queue_table => 'raw_order_queue_table'); end;"));
    } catch (Exception notThere) {
    }

    session.executeNonSelectingCall(
        new SQLCall(
            "begin DBMS_AQADM.CREATE_QUEUE_TABLE (queue_table => 'order_queue_table', multiple_consumers => FALSE, queue_payload_type => 'SYS.AQ$_JMS_TEXT_MESSAGE'); end;"));
    session.executeNonSelectingCall(
        new SQLCall(
            "begin DBMS_AQADM.CREATE_QUEUE (queue_name => 'order_queue', queue_table => 'order_queue_table'); end;"));
    session.executeNonSelectingCall(
        new SQLCall("begin DBMS_AQADM.START_QUEUE (queue_name => 'order_queue'); end;"));

    session.executeNonSelectingCall(
        new SQLCall(
            "begin DBMS_AQADM.CREATE_QUEUE_TABLE (queue_table => 'order_topic_table', multiple_consumers => TRUE, queue_payload_type => 'SYS.AQ$_JMS_TEXT_MESSAGE'); end;"));
    session.executeNonSelectingCall(
        new SQLCall(
            "begin DBMS_AQADM.CREATE_QUEUE (queue_name => 'order_topic', queue_table => 'order_topic_table'); end;"));
    session.executeNonSelectingCall(
        new SQLCall("begin DBMS_AQADM.START_QUEUE (queue_name => 'order_topic'); end;"));

    session.executeNonSelectingCall(
        new SQLCall(
            "begin DBMS_AQADM.CREATE_QUEUE_TABLE (queue_table => 'raw_order_queue_table', multiple_consumers => FALSE, queue_payload_type => 'RAW'); end;"));
    session.executeNonSelectingCall(
        new SQLCall(
            "begin DBMS_AQADM.CREATE_QUEUE (queue_name => 'raw_order_queue', queue_table => 'raw_order_queue_table'); end;"));
    session.executeNonSelectingCall(
        new SQLCall("begin DBMS_AQADM.START_QUEUE (queue_name => 'raw_order_queue'); end;"));

    session =
        XMLProjectReader.read(
                "org/eclipse/persistence/testing/models/order/eis/aq/order-project.xml",
                getClass().getClassLoader())
            .createDatabaseSession();
    session.setSessionLog(getSession().getSessionLog());

    // String url = oldSession.getLogin().getConnectionString();
    String url;
    try {
      url = ((AbstractSession) getSession()).getAccessor().getConnection().getMetaData().getURL();
    } catch (java.sql.SQLException se) {
      se.printStackTrace();
      throw new TestErrorException("There is SQLException");
    }
    EISLogin eisLogin = (EISLogin) session.getDatasourceLogin();
    eisLogin.setConnectionSpec(new AQEISConnectionSpec());
    eisLogin.setProperty(AQEISConnectionSpec.URL, url);
    eisLogin.setUserName("aquser");
    eisLogin.setPassword("aquser");
    session.login();

    getExecutor().setSession(session);
  }