DriverManagerConnectionFactory (Apache Tomcat 7.0.104 API Documentation)

org.apache.tomcat.dbcp.dbcp

## Class DriverManagerConnectionFactory

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

- All Implemented Interfaces:
    ConnectionFactory

      public class DriverManagerConnectionFactory
      extends Object
      implements ConnectionFactory

  A `DriverManager`-based implementation of `ConnectionFactory`.
  Author:
    Rodney Waldhoff, Ignacio J. Ortega, Dirk Verbeeck

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected String` | `_connectUri`
    `protected String` | `_passwd`
    `protected Properties` | `_props`
    `protected String` | `_uname`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DriverManagerConnectionFactory(String connectUri, Properties props)` Constructor for DriverManagerConnectionFactory.
    `DriverManagerConnectionFactory(String connectUri, String uname, String passwd)` Constructor for DriverManagerConnectionFactory.

  - ### Method Summary

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

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

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

- - ### Field Detail

    - #### _connectUri

          protected String _connectUri

    - #### _uname

          protected String _uname

    - #### _passwd

          protected String _passwd

    - #### _props

          protected Properties _props

  - ### Constructor Detail

    - #### DriverManagerConnectionFactory

          public DriverManagerConnectionFactory(String connectUri,
                                        Properties props)

      Constructor for DriverManagerConnectionFactory.
      Parameters:
        `connectUri` - a database url of the form `jdbc:subprotocol:subname`
        `props` - a list of arbitrary string tag/value pairs as connection arguments; normally at least a "user" and "password" property should be included.

    - #### DriverManagerConnectionFactory

          public DriverManagerConnectionFactory(String connectUri,
                                        String uname,
                                        String passwd)

      Constructor for DriverManagerConnectionFactory.
      Parameters:
        `connectUri` - a database url of the form `jdbc:subprotocol:subname`
        `uname` - the database user
        `passwd` - the user's password

  - ### Method Detail

    - #### createConnection

          public Connection createConnection()
                                      throws 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:
        `SQLException` - if a database error occurs creating the connection

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