Package net.officefloor.jdbc
Interface ConnectionWrapper
public interface ConnectionWrapper
Means to obtain the
Connection being wrapped.- Author:
- Daniel Sagenschneider
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionAllows obtaining the actualConnection.static ConnectiongetRealConnection(Connection connection) Obtains the "real"Connectionfrom the inputConnection.static MethodObtains thegetRealConnection()Method.static booleanisGetRealConnectionMethod(Method method) Indicates ifMethodis thegetRealConnection().
-
Field Details
-
GET_REAL_CONNECTION_METHOD_NAME
getRealConnection()Methodname.- See Also:
-
-
Method Details
-
isGetRealConnectionMethod
Indicates ifMethodis thegetRealConnection().- Parameters:
method-Method.- Returns:
trueifgetRealConnection().
-
getRealConnectionMethod
Obtains thegetRealConnection()Method.- Returns:
getRealConnection()Method.
-
getRealConnection
Obtains the "real"Connectionfrom the inputConnection.- Parameters:
connection-Connectionto inspect for the "real"Connection.- Returns:
- The "real"
Connectionornullif none. - Throws:
SQLException- If fails to obtain the "real"Connection.
-
getRealConnection
Allows obtaining the actual
Connection.Some implementations may
ProxytheConnectionto source on invocation of firstConnectionmethod. Therefore, in inspecting theConnectionon recycle, it will actually acquire aConnectionwhen none was required to be recycled (creating unnecessaryConnectioninstances).This enables obtaining the "real"
Connection.- Returns:
- The "real"
Connection. In some implementations it may actually benullas no "real" backingConnectionis available. - Throws:
SQLException- If fails to obtain the "real"Connection.
-