org.apache.tomcat.dbcp.dbcp

## Class DriverConnectionFactory

- java.lang.Object
- - org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory

- All Implemented Interfaces:
    ConnectionFactory

      public class DriverConnectionFactory
      extends java.lang.Object
      implements ConnectionFactory

  A `Driver`-based implementation of `ConnectionFactory`.
  Author:
    Rodney Waldhoff

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.lang.String` | `_connectUri`
    `protected java.sql.Driver` | `_driver`
    `protected java.util.Properties` | `_props`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DriverConnectionFactory(java.sql.Driver driver, java.lang.String connectUri, java.util.Properties props)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.sql.Connection` | `createConnection()` Create a new `Connection` in an implementation specific fashion.
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### _driver

          protected java.sql.Driver _driver

    - #### _connectUri

          protected java.lang.String _connectUri

    - #### _props

          protected java.util.Properties _props

  - ### Constructor Detail

    - #### DriverConnectionFactory

          public DriverConnectionFactory(java.sql.Driver driver,
                                 java.lang.String connectUri,
                                 java.util.Properties props)

  - ### Method Detail

    - #### createConnection

          public java.sql.Connection createConnection()
                                               throws java.sql.SQLException

      Description copied from interface: `ConnectionFactory`
      Create a new `Connection` in an implementation specific fashion.
      Specified by:
        `createConnection` in interface `ConnectionFactory`
      Returns:
        a new `Connection`
      Throws:
        `java.sql.SQLException` - if a database error occurs creating the connection

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.