Class DataSourceWrapper
java.lang.Object
de.aristaflow.adept2.base.registry.dbconfiguration.DataSourceWrapper
- All Implemented Interfaces:
Wrapper,CommonDataSource,DataSource
A simple wrapper for a
This implementation needs to be changed as soon as
JDBCDataSource which is required by
DatabaseConfiguration. Note that
only getConnection() is implemented. All other methods throw an
UnsupportedOperationException. This implementation needs to be changed as soon as
DatabaseConfiguration uses more than getConnection().- Author:
- Ulrich Kreher
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final JDBCDataSourceThe data source providing the connection.protected static final StringThe message for theUnsupportedOperationExceptions thrown by all methods exceptgetConnection(). -
Constructor Summary
ConstructorsConstructorDescriptionDataSourceWrapper(JDBCDataSource dataSource) Creates aDataSourceproviding a connection from the designatedJDBCDataSource. -
Method Summary
Modifier and TypeMethodDescriptiongetConnection(String username, String password) intbooleanisWrapperFor(Class<?> iface) voidsetLoginTimeout(int seconds) voidsetLogWriter(PrintWriter out) <T> TMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilderMethods inherited from interface javax.sql.DataSource
createConnectionBuilder
-
Field Details
-
unsupported
The message for theUnsupportedOperationExceptions thrown by all methods exceptgetConnection().- See Also:
-
dataSource
The data source providing the connection.
-
-
Constructor Details
-
DataSourceWrapper
Creates aDataSourceproviding a connection from the designatedJDBCDataSource.- Parameters:
dataSource- The data source providing the connection.
-
-
Method Details
-
getConnection
- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
getConnection
- Specified by:
getConnectionin interfaceDataSource
-
getLoginTimeout
public int getLoginTimeout()- Specified by:
getLoginTimeoutin interfaceCommonDataSource- Specified by:
getLoginTimeoutin interfaceDataSource
-
getLogWriter
- Specified by:
getLogWriterin interfaceCommonDataSource- Specified by:
getLogWriterin interfaceDataSource
-
setLoginTimeout
public void setLoginTimeout(int seconds) - Specified by:
setLoginTimeoutin interfaceCommonDataSource- Specified by:
setLoginTimeoutin interfaceDataSource
-
setLogWriter
- Specified by:
setLogWriterin interfaceCommonDataSource- Specified by:
setLogWriterin interfaceDataSource
-
isWrapperFor
- Specified by:
isWrapperForin interfaceWrapper- Throws:
SQLException
-
unwrap
- Specified by:
unwrapin interfaceWrapper- Throws:
SQLException
-
getParentLogger
- Specified by:
getParentLoggerin interfaceCommonDataSource- Throws:
SQLFeatureNotSupportedException
-