JavaServer Pages(TM) Standard Tag Library 1.2 API 1.0.3.Final

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

java.lang.Object
  extended by org.apache.taglibs.standard.tag.common.sql.DataSourceWrapper
All Implemented Interfaces:
Wrapper, CommonDataSource, 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.
 Logger getParentLogger()
          Always throws a SQLFeatureNotSupportedException.
 boolean isWrapperFor(Class<?> iface)
          Always return false.
 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)
           
<T> T
unwrap(Class<T> iface)
          Always throws a SQLException.
 
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 CommonDataSource
Throws:
SQLException

getLogWriter

public PrintWriter getLogWriter()
                         throws SQLException
Always throws a SQLException. Not supported.

Specified by:
getLogWriter in interface CommonDataSource
Throws:
SQLException

setLoginTimeout

public void setLoginTimeout(int seconds)
                     throws SQLException
Always throws a SQLException. Not supported.

Specified by:
setLoginTimeout in interface CommonDataSource
Throws:
SQLException

setLogWriter

public void setLogWriter(PrintWriter out)
                  throws SQLException
Always throws a SQLException. Not supported.

Specified by:
setLogWriter in interface CommonDataSource
Throws:
SQLException

isWrapperFor

public boolean isWrapperFor(Class<?> iface)
                     throws SQLException
Always return false.

Specified by:
isWrapperFor in interface Wrapper
Throws:
SQLException

unwrap

public <T> T unwrap(Class<T> iface)
         throws SQLException
Always throws a SQLException. Not supported.

Specified by:
unwrap in interface Wrapper
Throws:
SQLException

getParentLogger

public Logger getParentLogger()
                       throws SQLFeatureNotSupportedException
Always throws a SQLFeatureNotSupportedException. Not supported.

Throws:
SQLFeatureNotSupportedException

JavaServer Pages(TM) Standard Tag Library 1.2 API 1.0.3.Final

Copyright © 2012 JBoss by Red Hat. All Rights Reserved.