Class DataSourceWrapper
- java.lang.Object
-
- org.apache.taglibs.standard.tag.common.sql.DataSourceWrapper
-
- All Implemented Interfaces:
java.sql.Wrapper,javax.sql.CommonDataSource,javax.sql.DataSource
public class DataSourceWrapper extends java.lang.Object implements javax.sql.DataSourceA simple
DataSourcewrapper for the standardDriverManagerclass.
-
-
Constructor Summary
Constructors Constructor Description DataSourceWrapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.sql.ConnectiongetConnection()Returns a Connection using the DriverManager and all set properties.java.sql.ConnectiongetConnection(java.lang.String username, java.lang.String password)Always throws a SQLException.intgetLoginTimeout()Always throws a SQLException.java.io.PrintWritergetLogWriter()Always throws a SQLException.java.util.logging.LoggergetParentLogger()booleanisWrapperFor(java.lang.Class c)voidsetDriverClassName(java.lang.String driverClassName)voidsetJdbcURL(java.lang.String jdbcURL)voidsetLoginTimeout(int seconds)Always throws a SQLException.voidsetLogWriter(java.io.PrintWriter out)Always throws a SQLException.voidsetPassword(java.lang.String password)voidsetUserName(java.lang.String userName)java.lang.Objectunwrap(java.lang.Class c)
-
-
-
Method Detail
-
setDriverClassName
public void setDriverClassName(java.lang.String driverClassName) throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException- Throws:
java.lang.ClassNotFoundExceptionjava.lang.InstantiationExceptionjava.lang.IllegalAccessException
-
setJdbcURL
public void setJdbcURL(java.lang.String jdbcURL)
-
setUserName
public void setUserName(java.lang.String userName)
-
setPassword
public void setPassword(java.lang.String password)
-
getConnection
public java.sql.Connection getConnection() throws java.sql.SQLExceptionReturns a Connection using the DriverManager and all set properties.- Specified by:
getConnectionin interfacejavax.sql.DataSource- Throws:
java.sql.SQLException
-
getConnection
public java.sql.Connection getConnection(java.lang.String username, java.lang.String password) throws java.sql.SQLExceptionAlways throws a SQLException. Username and password are set in the constructor and can not be changed.- Specified by:
getConnectionin interfacejavax.sql.DataSource- Throws:
java.sql.SQLException
-
getLoginTimeout
public int getLoginTimeout() throws java.sql.SQLExceptionAlways throws a SQLException. Not supported.- Specified by:
getLoginTimeoutin interfacejavax.sql.CommonDataSource- Specified by:
getLoginTimeoutin interfacejavax.sql.DataSource- Throws:
java.sql.SQLException
-
getParentLogger
public java.util.logging.Logger getParentLogger()
- Specified by:
getParentLoggerin interfacejavax.sql.CommonDataSource
-
getLogWriter
public java.io.PrintWriter getLogWriter() throws java.sql.SQLExceptionAlways throws a SQLException. Not supported.- Specified by:
getLogWriterin interfacejavax.sql.CommonDataSource- Specified by:
getLogWriterin interfacejavax.sql.DataSource- Throws:
java.sql.SQLException
-
setLoginTimeout
public void setLoginTimeout(int seconds) throws java.sql.SQLExceptionAlways throws a SQLException. Not supported.- Specified by:
setLoginTimeoutin interfacejavax.sql.CommonDataSource- Specified by:
setLoginTimeoutin interfacejavax.sql.DataSource- Throws:
java.sql.SQLException
-
setLogWriter
public void setLogWriter(java.io.PrintWriter out) throws java.sql.SQLExceptionAlways throws a SQLException. Not supported.- Specified by:
setLogWriterin interfacejavax.sql.CommonDataSource- Specified by:
setLogWriterin interfacejavax.sql.DataSource- Throws:
java.sql.SQLException
-
isWrapperFor
public boolean isWrapperFor(java.lang.Class c) throws java.sql.SQLException- Specified by:
isWrapperForin interfacejava.sql.Wrapper- Throws:
java.sql.SQLException
-
unwrap
public java.lang.Object unwrap(java.lang.Class c) throws java.sql.SQLException- Specified by:
unwrapin interfacejava.sql.Wrapper- Throws:
java.sql.SQLException
-
-