Class DataSourceWrapper
java.lang.Object
org.apache.taglibs.standard.tag.common.sql.DataSourceWrapper
- All Implemented Interfaces:
Wrapper,CommonDataSource,DataSource
A simple DataSource wrapper for the standard
DriverManager class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a Connection using the DriverManager and all set properties.getConnection(String username, String password) Always throws a SQLException.intAlways throws a SQLException.Always throws a SQLException.booleanvoidsetDriverClassName(String driverClassName) voidsetJdbcURL(String jdbcURL) voidsetLoginTimeout(int seconds) Always throws a SQLException.voidsetLogWriter(PrintWriter out) Always throws a SQLException.voidsetPassword(String password) voidsetUserName(String userName) Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilderMethods inherited from interface javax.sql.DataSource
createConnectionBuilder
-
Constructor Details
-
DataSourceWrapper
public DataSourceWrapper()
-
-
Method Details
-
setDriverClassName
public void setDriverClassName(String driverClassName) throws ClassNotFoundException, InstantiationException, IllegalAccessException -
setJdbcURL
-
setUserName
-
setPassword
-
getConnection
Returns a Connection using the DriverManager and all set properties.- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
getConnection
Always throws a SQLException. Username and password are set in the constructor and can not be changed.- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
getLoginTimeout
Always throws a SQLException. Not supported.- Specified by:
getLoginTimeoutin interfaceCommonDataSource- Specified by:
getLoginTimeoutin interfaceDataSource- Throws:
SQLException
-
getParentLogger
- Specified by:
getParentLoggerin interfaceCommonDataSource
-
getLogWriter
Always throws a SQLException. Not supported.- Specified by:
getLogWriterin interfaceCommonDataSource- Specified by:
getLogWriterin interfaceDataSource- Throws:
SQLException
-
setLoginTimeout
Always throws a SQLException. Not supported.- Specified by:
setLoginTimeoutin interfaceCommonDataSource- Specified by:
setLoginTimeoutin interfaceDataSource- Throws:
SQLException
-
setLogWriter
Always throws a SQLException. Not supported.- Specified by:
setLogWriterin interfaceCommonDataSource- Specified by:
setLogWriterin interfaceDataSource- Throws:
SQLException
-
isWrapperFor
- Specified by:
isWrapperForin interfaceWrapper- Throws:
SQLException
-
unwrap
- Specified by:
unwrapin interfaceWrapper- Throws:
SQLException
-