public class DataSourceWrapper
extends java.lang.Object
javax.sql.DataSource的包装类,包装所有检查异常(SQLEception)为非检查异常(JdbcException)
| 构造器和说明 |
|---|
DataSourceWrapper(javax.sql.DataSource dataSource)
Instantiates a new data source wrapper.
|
| 限定符和类型 | 方法和说明 |
|---|---|
ConnectionWrapper |
getConnection()
Gets the connection.
|
ConnectionWrapper |
getConnection(java.lang.String username,
java.lang.String password)
Gets the connection.
|
javax.sql.DataSource |
getDataSource()
Gets the data source.
|
int |
getLoginTimeout()
Gets the login timeout.
|
java.io.PrintWriter |
getLogWriter()
Gets the log writer.
|
boolean |
isWrapperFor(java.lang.Class<?> iface)
Checks if is wrapper for.
|
void |
setLoginTimeout(int seconds)
Sets the login timeout.
|
void |
setLogWriter(java.io.PrintWriter out)
Sets the log writer.
|
<T> T |
unwrap(java.lang.Class<T> iface)
Unwrap.
|
public DataSourceWrapper(javax.sql.DataSource dataSource)
dataSource - the data sourcepublic ConnectionWrapper getConnection()
DataSourcepublic ConnectionWrapper getConnection(java.lang.String username, java.lang.String password)
username - the usernamepassword - the passwordDataSourcepublic java.io.PrintWriter getLogWriter()
DataSourcepublic int getLoginTimeout()
DataSourcepublic void setLogWriter(java.io.PrintWriter out)
out - the new log writerDataSourcepublic void setLoginTimeout(int seconds)
seconds - the new login timeoutDataSourcepublic boolean isWrapperFor(java.lang.Class<?> iface)
iface - the ifaceDataSourcepublic <T> T unwrap(java.lang.Class<T> iface)
T - the generic typeiface - the ifaceDataSourcepublic javax.sql.DataSource getDataSource()