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 ConnectiongetConnection()Gets the connection.ConnectiongetConnection(String username, String password)Gets the connection.intgetLoginTimeout()Gets the login timeout.PrintWritergetLogWriter()Gets the log writer.LoggergetParentLogger()Gets the parent logger.booleanisWrapperFor(Class<?> arg0)Checks if is wrapper for.voidsetLoginTimeout(int arg0)Sets the login timeout.voidsetLogWriter(PrintWriter arg0)Sets the log writer.<T> Tunwrap(Class<T> arg0)Unwrap.
-
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
-
getConnection
Gets the connection.- Specified by:
getConnectionin interfaceDataSource- Returns:
- the connection
- Throws:
SQLException- the SQL exception
-
getConnection
Gets the connection.- Specified by:
getConnectionin interfaceDataSource- Parameters:
username- the usernamepassword- the password- Returns:
- the connection
- Throws:
SQLException- the SQL exception
-
getLogWriter
Gets the log writer.- Specified by:
getLogWriterin interfaceCommonDataSource- Specified by:
getLogWriterin interfaceDataSource- Returns:
- the log writer
- Throws:
SQLException- the SQL exception
-
getLoginTimeout
Gets the login timeout.- Specified by:
getLoginTimeoutin interfaceCommonDataSource- Specified by:
getLoginTimeoutin interfaceDataSource- Returns:
- the login timeout
- Throws:
SQLException- the SQL exception
-
isWrapperFor
Checks if is wrapper for.- Specified by:
isWrapperForin interfaceWrapper- Parameters:
arg0- the arg 0- Returns:
- true, if is wrapper for
- Throws:
SQLException- the SQL exception
-
setLogWriter
Sets the log writer.- Specified by:
setLogWriterin interfaceCommonDataSource- Specified by:
setLogWriterin interfaceDataSource- Parameters:
arg0- the new log writer- Throws:
SQLException- the SQL exception
-
setLoginTimeout
Sets the login timeout.- Specified by:
setLoginTimeoutin interfaceCommonDataSource- Specified by:
setLoginTimeoutin interfaceDataSource- Parameters:
arg0- the new login timeout- Throws:
SQLException- the SQL exception
-
unwrap
Unwrap.- Specified by:
unwrapin interfaceWrapper- Type Parameters:
T- the generic type- Parameters:
arg0- the arg 0- Returns:
- the t
- Throws:
SQLException- the SQL exception
-
getParentLogger
Gets the parent logger.- Specified by:
getParentLoggerin interfaceCommonDataSource- Returns:
- the parent logger
- Throws:
SQLFeatureNotSupportedException- the SQL feature not supported exception
-