/**
   * Get a Connection to the database from the underlying driver that this DriverSpy is spying on.
   * If logging is not enabled, an actual Connection to the database returned. If logging is
   * enabled, a ConnectionSpy object which wraps the real Connection is returned.
   *
   * @param url JDBC connection URL .
   * @param info a list of arbitrary string tag/value pairs as connection arguments. Normally at
   *     least a "user" and "password" property should be included.
   * @return a <code>Connection</code> object that represents a connection to the URL.
   * @throws SQLException if a database access error occurs
   */
  public Connection connect(String url, Properties info) throws SQLException {
    Driver d = getUnderlyingDriver(url);
    if (d == null) {
      return null;
    }

    // get actual URL that the real driver expects
    // (strip off "jdbc:log4" from url)
    url = url.substring(9);

    lastUnderlyingDriverRequested = d;
    Connection c = d.connect(url, info);

    if (c == null) {
      throw new SQLException("invalid or unknown driver url: " + url);
    }
    if (log.isJdbcLoggingEnabled()) {
      ConnectionSpy cspy = new ConnectionSpy(c);
      RdbmsSpecifics r = null;
      String dclass = d.getClass().getName();
      if (dclass != null && dclass.length() > 0) {
        r = (RdbmsSpecifics) rdbmsSpecifics.get(dclass);
      }

      if (r == null) {
        r = defaultRdbmsSpecifics;
      }
      cspy.setRdbmsSpecifics(r);
      return cspy;
    } else {
      return c;
    }
  }
 /**
  * Create a PreparedStatementSpy (JDBC 4 version) for logging activity of another
  * PreparedStatement.
  *
  * @param sql SQL for the prepared statement that is being spied upon.
  * @param connectionSpy ConnectionSpy that was called to produce this PreparedStatement.
  * @param realPreparedStatement The actual PreparedStatement that is being spied upon.
  */
 public PreparedStatementSpy(
     String sql, ConnectionSpy connectionSpy, PreparedStatement realPreparedStatement) {
   super(connectionSpy, realPreparedStatement); // does null check for us
   this.sql = sql;
   this.realPreparedStatement = realPreparedStatement;
   rdbmsSpecifics = connectionSpy.getRdbmsSpecifics();
 }