Package net.officefloor.jdbc
Interface DataSourceWrapper
-
public interface DataSourceWrapperMeans to obtain theDataSourcebeing wrapped.- Author:
- Daniel Sagenschneider
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringGET_REAL_DATA_SOURCE_METHOD_NAMEgetRealDataSource()Methodname.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description javax.sql.DataSourcegetRealDataSource()Allows obtaining the actualDataSource.static javax.sql.DataSourcegetRealDataSource(javax.sql.DataSource dataSource)Obtains the "real"DataSourcefrom the inputDataSource.static java.lang.reflect.MethodgetRealDataSourceMethod()Obtains thegetRealDataSource()Method.static booleanisGetRealDataSourceMethod(java.lang.reflect.Method method)Indicates ifMethodis thegetRealDataSource().
-
-
-
Field Detail
-
GET_REAL_DATA_SOURCE_METHOD_NAME
static final java.lang.String GET_REAL_DATA_SOURCE_METHOD_NAME
getRealDataSource()Methodname.- See Also:
- Constant Field Values
-
-
Method Detail
-
isGetRealDataSourceMethod
static boolean isGetRealDataSourceMethod(java.lang.reflect.Method method)
Indicates ifMethodis thegetRealDataSource().- Parameters:
method-Method.- Returns:
trueifgetRealDataSource().
-
getRealDataSourceMethod
static java.lang.reflect.Method getRealDataSourceMethod()
Obtains thegetRealDataSource()Method.- Returns:
getRealDataSource()Method.
-
getRealDataSource
static javax.sql.DataSource getRealDataSource(javax.sql.DataSource dataSource) throws java.sql.SQLExceptionObtains the "real"DataSourcefrom the inputDataSource.- Parameters:
dataSource-DataSourceto inspect for the "real"DataSource.- Returns:
- The "real"
DataSource. - Throws:
java.sql.SQLException- If fails to obtain the "real"DataSource.
-
getRealDataSource
javax.sql.DataSource getRealDataSource() throws java.sql.SQLExceptionAllows obtaining the actual
DataSource.Some implementations may
ProxytheDataSource. Therefore, in inspecting theDataSourceon closingOfficeFloor, it will incorrectly determine if theDataSourceisAutoCloseable.This enables obtaining the "real"
DataSource.- Returns:
- The "real"
DataSource. In some implementations it may actually benullas no "real" backingDataSourceis available. - Throws:
java.sql.SQLException- If fails to obtain the "real"DataSource.
-
-