/**
  * Creates a pooled connection object with the properties specified.
  *
  * @param props properties for the Type 4 connection
  * @see #HPT4ConnectionPoolDataSource()
  * @link T4Properties
  */
 public HPT4ConnectionPoolDataSource(Properties props) {
   super(props);
   if (getT4LogLevel() != Level.OFF) setupLogFileHandler();
   if (t4Logger_.isLoggable(Level.FINE) == true) {
     Object p[] = T4LoggingUtilities.makeParams(null, props);
     t4Logger_.logp(
         Level.FINE,
         "HPT4ConnectionPoolDataSource",
         "HPT4ConnectionPoolDataSource",
         "Note, super called before this.",
         p);
   }
   try {
     if (getLogWriter() != null) {
       LogRecord lr = new LogRecord(Level.FINE, "");
       Object p[] = T4LoggingUtilities.makeParams(null, props);
       lr.setParameters(p);
       lr.setSourceClassName("HPT4ConnectionPoolDataSource");
       lr.setSourceMethodName("");
       T4LogFormatter lf = new T4LogFormatter();
       String temp = lf.format(lr);
       getLogWriter().println(temp);
     }
   } catch (SQLException se) {
     // ignore
   }
 }
  /**
   * Returns all the properties associated with this <code>ConnectionPoolDataSource</code>.
   *
   * @return Reference Object containing all the Type 4 property references.
   * @throws NamingException
   */
  public Reference getReference() throws NamingException {
    if (t4Logger_ != null && t4Logger_.isLoggable(Level.FINE) == true) {
      Object p[] = T4LoggingUtilities.makeParams(null);
      t4Logger_.logp(Level.FINE, "HPT4ConnectionPoolDataSource", "getReference", "", p);
    }
    try {
      if (getLogWriter() != null) {
        LogRecord lr = new LogRecord(Level.FINE, "");
        Object p[] = T4LoggingUtilities.makeParams(null);
        lr.setParameters(p);
        lr.setSourceClassName("HPT4ConnectionPoolDataSource");
        lr.setSourceMethodName("getReference");
        T4LogFormatter lf = new T4LogFormatter();
        String temp = lf.format(lr);
        getLogWriter().println(temp);
      }
    } catch (SQLException se) {
      // ignore
    }

    Reference ref =
        new Reference(
            this.getClass().getName(),
            "org.trafodion.jdbc.t4.HPT4ConnectionPoolDataSourceFactory",
            null);
    ref = addReferences(ref);
    ref.add(new StringRefAddr("propertyCycle", Integer.toString(propertyCycle_)));
    return ref;
  }
 /**
  * Returns the Property cycle property. This property is not supprted by the Type 4 driver. This
  * property is ignored by the Type 4 driver.
  *
  * @return propertyCycle
  */
 public int getPropertyCycle() {
   if (t4Logger_.isLoggable(Level.FINE) == true) {
     Object p[] = T4LoggingUtilities.makeParams(null);
     t4Logger_.logp(Level.FINE, "HPT4ConnectionPoolDataSource", "getPropertyCycle", "", p);
   }
   try {
     if (getLogWriter() != null) {
       LogRecord lr = new LogRecord(Level.FINE, "");
       Object p[] = T4LoggingUtilities.makeParams(null);
       lr.setParameters(p);
       lr.setSourceClassName("HPT4ConnectionPoolDataSource");
       lr.setSourceMethodName("getPropertyCycle");
       T4LogFormatter lf = new T4LogFormatter();
       String temp = lf.format(lr);
       getLogWriter().println(temp);
     }
   } catch (SQLException se) {
     // ignore
   }
   return propertyCycle_;
 }
  /**
   * Attempts to establish a physical database connection that can be used as a pooled connection.
   *
   * @param username Safeguard user name.
   * @param password Safeguard user password.
   * @return A <code>PooledConnection</code> object that is a physical connection to the NDCS server
   *     that this <code>HPT4ConnectionPoolDataSource</code> object represents.
   * @throws SQLException If any NDCS error occurs.
   */
  public PooledConnection getPooledConnection(String username, String password)
      throws SQLException {
    if (t4Logger_.isLoggable(Level.FINE) == true) {
      Object p[] = T4LoggingUtilities.makeParams(null, username);
      t4Logger_.logp(Level.FINE, "HPT4ConnectionPoolDataSource", "getPooledConnection", "", p);
    }
    if (getLogWriter() != null) {
      LogRecord lr = new LogRecord(Level.FINE, "");
      Object p[] = T4LoggingUtilities.makeParams(null, username);
      lr.setParameters(p);
      lr.setSourceClassName("HPT4ConnectionPoolDataSource");
      lr.setSourceMethodName("getPooledConnection");
      T4LogFormatter lf = new T4LogFormatter();
      String temp = lf.format(lr);
      getLogWriter().println(temp);
    }
    HPT4PooledConnection connect;

    setUser(username);
    setPassword(password);
    return getPooledConnection();
  }
  /**
   * Attempts to establish a physical database connection that can be used as a pooled connection.
   *
   * @return A <code>PooledConnection</code> object that is a physical connection to the NDCS server
   *     that this <code>HPT4ConnectionPoolDataSource</code> object represents.
   * @throws SQLException If any NDCS error occurs.
   */
  public PooledConnection getPooledConnection() throws SQLException {
    if (t4Logger_.isLoggable(Level.FINE) == true) {
      Object p[] = T4LoggingUtilities.makeParams(null);
      t4Logger_.logp(Level.FINE, "HPT4ConnectionPoolDataSource", "getPooledConnection", "", p);
    }
    if (getLogWriter() != null) {
      LogRecord lr = new LogRecord(Level.FINE, "");
      Object p[] = T4LoggingUtilities.makeParams(null);
      lr.setParameters(p);
      lr.setSourceClassName("HPT4ConnectionPoolDataSource");
      lr.setSourceMethodName("getPooledConnection");
      T4LogFormatter lf = new T4LogFormatter();
      String temp = lf.format(lr);
      getLogWriter().println(temp);
    }
    HPT4PooledConnection connect;

    Properties l_props = super.getProperties();
    T4Properties l_t4props = new T4Properties(l_props);
    connect = new HPT4PooledConnection(this, l_t4props);

    return connect;
  }