org.jboss.jca.adapters.jdbc

## Class WrapperDataSource

- java.lang.Object
- - org.jboss.jca.adapters.jdbc.JBossWrapper
  - - org.jboss.jca.adapters.jdbc.WrapperDataSource

- All Implemented Interfaces:
    java.io.Serializable, java.sql.Wrapper, javax.naming.Referenceable, javax.sql.CommonDataSource, javax.sql.DataSource

      public class WrapperDataSource
      extends JBossWrapper
      implements javax.resource.Referenceable, javax.sql.DataSource, java.io.Serializable

  WrapperDataSource
  Version:
    $Revision: 71788 $
  Author:
    David Jencks, Adrian Brock, Jesper Pedersen
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class org.jboss.jca.adapters.jdbc.JBossWrapper

      `bundle`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `WrapperDataSource(BaseWrapperManagedConnectionFactory mcf, javax.resource.spi.ConnectionManager cm, ClassLoaderPlugin classLoaderPlugin)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `checkTransactionActive()` Check whether a tranasction is active
    `java.sql.Connection` | `getConnection()`
    `java.sql.Connection` | `getConnection(java.lang.String user, java.lang.String password)`
    `int` | `getLoginTimeout()`
    `java.io.PrintWriter` | `getLogWriter()`
    `java.util.logging.Logger` | `getParentLogger()`
    `javax.naming.Reference` | `getReference()`
    `protected int` | `getTimeLeftBeforeTransactionTimeout()` Get the time left before a transaction timeout
    `void` | `setLoginTimeout(int param1)`
    `void` | `setLogWriter(java.io.PrintWriter pw)`
    `void` | `setReference(javax.naming.Reference reference)`

    - ### Methods inherited from class org.jboss.jca.adapters.jdbc.JBossWrapper

      `getWrappedObject, isWrapperFor, unwrap`

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

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

    - ### Methods inherited from interface java.sql.Wrapper

      `isWrapperFor, unwrap`

- - ### Constructor Detail

    - #### WrapperDataSource

          protected WrapperDataSource(BaseWrapperManagedConnectionFactory mcf,
                                      javax.resource.spi.ConnectionManager cm,
                                      ClassLoaderPlugin classLoaderPlugin)

      Constructor
      Parameters:
        `mcf` - The managed connection factory
        `cm` - The connection manager

  - ### Method Detail

    - #### getLogWriter

          public java.io.PrintWriter getLogWriter()
                                           throws java.sql.SQLException

      Specified by:
        `getLogWriter` in interface `javax.sql.CommonDataSource`
      Throws:
        `java.sql.SQLException`

    - #### setLogWriter

          public void setLogWriter(java.io.PrintWriter pw)
                            throws java.sql.SQLException

      Specified by:
        `setLogWriter` in interface `javax.sql.CommonDataSource`
      Throws:
        `java.sql.SQLException`

    - #### getLoginTimeout

          public int getLoginTimeout()
                              throws java.sql.SQLException

      Specified by:
        `getLoginTimeout` in interface `javax.sql.CommonDataSource`
      Throws:
        `java.sql.SQLException`

    - #### setLoginTimeout

          public void setLoginTimeout(int param1)
                               throws java.sql.SQLException

      Specified by:
        `setLoginTimeout` in interface `javax.sql.CommonDataSource`
      Throws:
        `java.sql.SQLException`

    - #### getParentLogger

          public java.util.logging.Logger getParentLogger()
                                                   throws java.sql.SQLFeatureNotSupportedException

      Specified by:
        `getParentLogger` in interface `javax.sql.CommonDataSource`
      Throws:
        `java.sql.SQLFeatureNotSupportedException`

    - #### getConnection

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

      Specified by:
        `getConnection` in interface `javax.sql.DataSource`
      Throws:
        `java.sql.SQLException`

    - #### getConnection

          public java.sql.Connection getConnection(java.lang.String user,
                                                   java.lang.String password)
                                            throws java.sql.SQLException

      Specified by:
        `getConnection` in interface `javax.sql.DataSource`
      Throws:
        `java.sql.SQLException`

    - #### setReference

          public void setReference(javax.naming.Reference reference)

    - #### getReference

          public javax.naming.Reference getReference()

      Specified by:
        `getReference` in interface `javax.naming.Referenceable`

    - #### getTimeLeftBeforeTransactionTimeout

          protected int getTimeLeftBeforeTransactionTimeout()
                                                     throws java.sql.SQLException

      Get the time left before a transaction timeout
      Returns:
        The amount in seconds; `-1` if no timeout
      Throws:
        `java.sql.SQLException` - Thrown if an error occurs

    - #### checkTransactionActive

          protected void checkTransactionActive()
                                         throws java.sql.SQLException

      Check whether a tranasction is active
      Throws:
        `java.sql.SQLException` - if the transaction is not active, preparing, prepared or committing or for any error in the transaction manager

Copyright © 2014 IronJacamar (http://www.ironjacamar.org)