Class WrappedDataSource
java.lang.Object
org.eclipse.dirigible.database.api.wrappers.WrappedDataSource
- All Implemented Interfaces:
Wrapper,CommonDataSource,DataSource
public class WrappedDataSource extends Object implements DataSource
The WrappedDataSource of the standard JDBC
DataSource object with added some additional capabilities..-
Constructor Summary
Constructors Constructor Description WrappedDataSource(DataSource originalDataSource)Wrapper of the default datasource provided by the underlying platform It has some fault tolerance features, which are not available by default in the popular JDBC drivers. -
Method Summary
Modifier and Type Method Description voidclosedConnection(WrappedConnection wrappedConnection)Closed connection.ConnectiongetConnection()ConnectiongetConnection(String username, String password)intgetLoginTimeout()PrintWritergetLogWriter()protected WrappedConnectiongetOldestConnection()Gets the oldest connection.LoggergetParentLogger()protected voidinitAutoCommitEnabled()Inits the auto commit enabled.protected voidinitMaxConnectionsCount()Inits the max connections count.protected voidinitWaitCount()Inits the wait count.protected voidinitWaitTimeout()Inits the wait timeout.booleanisWrapperFor(Class<?> arg0)voidsetLoginTimeout(int arg0)voidsetLogWriter(PrintWriter arg0)<T> Tunwrap(Class<T> arg0)
-
Constructor Details
-
WrappedDataSource
Wrapper of the default datasource provided by the underlying platform It has some fault tolerance features, which are not available by default in the popular JDBC drivers.- Parameters:
originalDataSource- the original data source
-
-
Method Details
-
initAutoCommitEnabled
protected void initAutoCommitEnabled()Inits the auto commit enabled. -
initMaxConnectionsCount
protected void initMaxConnectionsCount()Inits the max connections count. -
initWaitTimeout
protected void initWaitTimeout()Inits the wait timeout. -
initWaitCount
protected void initWaitCount()Inits the wait count. -
getConnection
- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
getConnection
- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
getOldestConnection
Gets the oldest connection.- Returns:
- the oldest connection
-
closedConnection
Closed connection.- Parameters:
wrappedConnection- the wrapped connection
-
getLogWriter
- Specified by:
getLogWriterin interfaceCommonDataSource- Specified by:
getLogWriterin interfaceDataSource- Throws:
SQLException
-
getLoginTimeout
- Specified by:
getLoginTimeoutin interfaceCommonDataSource- Specified by:
getLoginTimeoutin interfaceDataSource- Throws:
SQLException
-
isWrapperFor
- Specified by:
isWrapperForin interfaceWrapper- Throws:
SQLException
-
setLogWriter
- Specified by:
setLogWriterin interfaceCommonDataSource- Specified by:
setLogWriterin interfaceDataSource- Throws:
SQLException
-
setLoginTimeout
- Specified by:
setLoginTimeoutin interfaceCommonDataSource- Specified by:
setLoginTimeoutin interfaceDataSource- Throws:
SQLException
-
unwrap
- Specified by:
unwrapin interfaceWrapper- Throws:
SQLException
-
getParentLogger
- Specified by:
getParentLoggerin interfaceCommonDataSource- Throws:
SQLFeatureNotSupportedException
-