DataSourceLinkFactory.DataSourceHandler (Apache Tomcat 8.5.96 API Documentation)

Package org.apache.naming.factory

## Class DataSourceLinkFactory.DataSourceHandler

- java.lang.Object
- - org.apache.naming.factory.DataSourceLinkFactory.DataSourceHandler

- All Implemented Interfaces:
    `java.lang.reflect.InvocationHandler`
  Enclosing class:
    DataSourceLinkFactory

      public static class DataSourceLinkFactory.DataSourceHandler
      extends java.lang.Object
      implements java.lang.reflect.InvocationHandler

  Simple wrapper class that will allow a user to configure a ResourceLink for a data source so that when `DataSource.getConnection()` is called, it will invoke `DataSource.getConnection(String, String)` with the preconfigured username and password.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DataSourceHandler​(javax.sql.DataSource ds, java.lang.String username, java.lang.String password)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.lang.Object` | `invoke​(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)` |
    `java.lang.Object` | `unwrap​(java.lang.Class<?> iface)` |

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

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

- - ### Constructor Detail

    - #### DataSourceHandler

          public DataSourceHandler​(javax.sql.DataSource ds,
                                   java.lang.String username,
                                   java.lang.String password)
                            throws java.lang.Exception

      Throws:
        `java.lang.Exception`

  - ### Method Detail

    - #### invoke

          public java.lang.Object invoke​(java.lang.Object proxy,
                                         java.lang.reflect.Method method,
                                         java.lang.Object[] args)
                                  throws java.lang.Throwable

      Specified by:
        `invoke` in interface `java.lang.reflect.InvocationHandler`
      Throws:
        `java.lang.Throwable`

    - #### unwrap

          public java.lang.Object unwrap​(java.lang.Class<?> iface)
                                  throws java.sql.SQLException

      Throws:
        `java.sql.SQLException`