Package net.officefloor.jdbc
Interface ConnectionWrapper
-
public interface ConnectionWrapper
Means to obtain theConnection
being wrapped.- Author:
- Daniel Sagenschneider
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
GET_REAL_CONNECTION_METHOD_NAME
getRealConnection()
Method
name.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description java.sql.Connection
getRealConnection()
Allows obtaining the actualConnection
.static java.sql.Connection
getRealConnection(java.sql.Connection connection)
Obtains the "real"Connection
from the inputConnection
.static java.lang.reflect.Method
getRealConnectionMethod()
Obtains thegetRealConnection()
Method
.static boolean
isGetRealConnectionMethod(java.lang.reflect.Method method)
Indicates ifMethod
is thegetRealConnection()
.
-
-
-
Field Detail
-
GET_REAL_CONNECTION_METHOD_NAME
static final java.lang.String GET_REAL_CONNECTION_METHOD_NAME
getRealConnection()
Method
name.- See Also:
- Constant Field Values
-
-
Method Detail
-
isGetRealConnectionMethod
static boolean isGetRealConnectionMethod(java.lang.reflect.Method method)
Indicates ifMethod
is thegetRealConnection()
.- Parameters:
method
-Method
.- Returns:
true
ifgetRealConnection()
.
-
getRealConnectionMethod
static java.lang.reflect.Method getRealConnectionMethod()
Obtains thegetRealConnection()
Method
.- Returns:
getRealConnection()
Method
.
-
getRealConnection
static java.sql.Connection getRealConnection(java.sql.Connection connection) throws java.sql.SQLException
Obtains the "real"Connection
from the inputConnection
.- Parameters:
connection
-Connection
to inspect for the "real"Connection
.- Returns:
- The "real"
Connection
ornull
if none. - Throws:
java.sql.SQLException
- If fails to obtain the "real"Connection
.
-
getRealConnection
java.sql.Connection getRealConnection() throws java.sql.SQLException
Allows obtaining the actual
Connection
.Some implementations may
Proxy
theConnection
to source on invocation of firstConnection
method. Therefore, in inspecting theConnection
on recycle, it will actually acquire aConnection
when none was required to be recycled (creating unnecessaryConnection
instances).This enables obtaining the "real"
Connection
.- Returns:
- The "real"
Connection
. In some implementations it may actually benull
as no "real" backingConnection
is available. - Throws:
java.sql.SQLException
- If fails to obtain the "real"Connection
.
-
-