Class DataSourceWrapper
java.lang.Object
cloud.piranha.extension.datasource.DataSourceWrapper
- All Implemented Interfaces:
Wrapper
,CommonDataSource
,DataSource
- Direct Known Subclasses:
TxJoiningDataSource
Wrapper for a data source.
- Author:
- Arjan Tijms
-
Constructor Summary
ConstructorDescriptionDataSourceWrapper
(DataSource wrapped) Creates a wrapper with the given data source -
Method Summary
Modifier and TypeMethodDescriptiongetConnection
(String username, String password) int
Return the data source being wrappedboolean
isWrapperFor
(Class<?> iface) void
setLoginTimeout
(int seconds) void
setLogWriter
(PrintWriter out) <T> T
-
Constructor Details
-
DataSourceWrapper
Creates a wrapper with the given data source- Parameters:
wrapped
- the data source being wrapped
-
-
Method Details
-
getWrapped
Return the data source being wrapped- Returns:
- the wrapped data source
-
unwrap
- Specified by:
unwrap
in interfaceWrapper
- Throws:
SQLException
-
isWrapperFor
- Specified by:
isWrapperFor
in interfaceWrapper
- Throws:
SQLException
-
getConnection
- Specified by:
getConnection
in interfaceDataSource
- Throws:
SQLException
-
getConnection
- Specified by:
getConnection
in interfaceDataSource
- Throws:
SQLException
-
getParentLogger
- Specified by:
getParentLogger
in interfaceCommonDataSource
- Throws:
SQLFeatureNotSupportedException
-
getLogWriter
- Specified by:
getLogWriter
in interfaceCommonDataSource
- Specified by:
getLogWriter
in interfaceDataSource
- Throws:
SQLException
-
setLogWriter
- Specified by:
setLogWriter
in interfaceCommonDataSource
- Specified by:
setLogWriter
in interfaceDataSource
- Throws:
SQLException
-
setLoginTimeout
- Specified by:
setLoginTimeout
in interfaceCommonDataSource
- Specified by:
setLoginTimeout
in interfaceDataSource
- Throws:
SQLException
-
getLoginTimeout
- Specified by:
getLoginTimeout
in interfaceCommonDataSource
- Specified by:
getLoginTimeout
in interfaceDataSource
- Throws:
SQLException
-
createConnectionBuilder
- Specified by:
createConnectionBuilder
in interfaceDataSource
- Throws:
SQLException
-
createShardingKeyBuilder
- Specified by:
createShardingKeyBuilder
in interfaceCommonDataSource
- Throws:
SQLException
-