DataSourceConnectionFactory (Apache Tomcat 7.0.96 API Documentation)

org.apache.tomcat.dbcp.dbcp

## Class DataSourceConnectionFactory

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

- All Implemented Interfaces:
    ConnectionFactory

      public class DataSourceConnectionFactory
      extends java.lang.Object
      implements ConnectionFactory

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

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.lang.String` | `_passwd`
    `protected javax.sql.DataSource` | `_source`
    `protected java.lang.String` | `_uname`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DataSourceConnectionFactory(javax.sql.DataSource source)`
    `DataSourceConnectionFactory(javax.sql.DataSource source, java.lang.String uname, java.lang.String passwd)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.sql.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

    - #### _uname

          protected java.lang.String _uname

    - #### _passwd

          protected java.lang.String _passwd

    - #### _source

          protected javax.sql.DataSource _source

  - ### Constructor Detail

    - #### DataSourceConnectionFactory

          public DataSourceConnectionFactory(javax.sql.DataSource source)

    - #### DataSourceConnectionFactory

          public DataSourceConnectionFactory(javax.sql.DataSource source,
                                     java.lang.String uname,
                                     java.lang.String passwd)

  - ### 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

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