## org.apache.taglibs.standard.tag.common.sql
Class DataSourceWrapper

    java.lang.Object
      org.apache.taglibs.standard.tag.common.sql.DataSourceWrapper

All Implemented Interfaces:
  DataSource

    public class DataSourceWrapper

extends Object
implements DataSource

A simple `DataSource` wrapper for the standard `DriverManager` class.

Author:
  Hans Bergsten

Constructor Summary
`DataSourceWrapper()`

Method Summary
`Connection` `getConnection()` Returns a Connection using the DriverManager and all set properties.
`Connection` `getConnection(String username, String password)` Always throws a SQLException.
`int` `getLoginTimeout()` Always throws a SQLException.
`PrintWriter` `getLogWriter()` Always throws a SQLException.
`void` `setDriverClassName(String driverClassName)`
`void` `setJdbcURL(String jdbcURL)`
`void` `setLoginTimeout(int seconds)` Always throws a SQLException.
`void` `setLogWriter(PrintWriter out)` Always throws a SQLException.
`void` `setPassword(String password)`
`void` `setUserName(String userName)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DataSourceWrapper

    public DataSourceWrapper()

Method Detail

### setDriverClassName

    public void setDriverClassName(String driverClassName)
                            throws ClassNotFoundException,
                                   InstantiationException,
                                   IllegalAccessException

  Throws:
    `ClassNotFoundException`
    `InstantiationException`
    `IllegalAccessException`

### setJdbcURL

    public void setJdbcURL(String jdbcURL)

### setUserName

    public void setUserName(String userName)

### setPassword

    public void setPassword(String password)

### getConnection

    public Connection getConnection()
                             throws SQLException

  Returns a Connection using the DriverManager and all set properties.

  Specified by:
    `getConnection` in interface `DataSource`
  Throws:
    `SQLException`

### getConnection

    public Connection getConnection(String username,
                                    String password)
                             throws SQLException

  Always throws a SQLException. Username and password are set in the constructor and can not be changed.

  Specified by:
    `getConnection` in interface `DataSource`
  Throws:
    `SQLException`

### getLoginTimeout

    public int getLoginTimeout()
                        throws SQLException

  Always throws a SQLException. Not supported.

  Specified by:
    `getLoginTimeout` in interface `DataSource`
  Throws:
    `SQLException`

### getLogWriter

    public PrintWriter getLogWriter()
                             throws SQLException

  Always throws a SQLException. Not supported.

  Specified by:
    `getLogWriter` in interface `DataSource`
  Throws:
    `SQLException`

### setLoginTimeout

    public void setLoginTimeout(int seconds)
                         throws SQLException

  Always throws a SQLException. Not supported.

  Specified by:
    `setLoginTimeout` in interface `DataSource`
  Throws:
    `SQLException`

### setLogWriter

    public void setLogWriter(PrintWriter out)
                      throws SQLException

  Always throws a SQLException. Not supported.

  Specified by:
    `setLogWriter` in interface `DataSource`
  Throws:
    `SQLException`

Copyright © 2007 Mort Bay Consulting. All Rights Reserved.