org.springframework.jdbc.datasource
Class LazyConnectionDataSourceProxy.LazyConnectionInvocationHandler
java.lang.Object
org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy.LazyConnectionInvocationHandler
- All Implemented Interfaces:
- java.lang.reflect.InvocationHandler
- Enclosing class:
- LazyConnectionDataSourceProxy
private class LazyConnectionDataSourceProxy.LazyConnectionInvocationHandler
- extends java.lang.Object
- implements java.lang.reflect.InvocationHandler
Invocation handler that defers fetching an actual JDBC Connection
until first creation of a Statement.
Method Summary |
private java.sql.Connection |
getTargetConnection(java.lang.reflect.Method operation)
Return the target Connection, fetching it and initializing it if necessary. |
private boolean |
hasTargetConnection()
Return whether the proxy currently holds a target Connection. |
java.lang.Object |
invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
username
private java.lang.String username
password
private java.lang.String password
readOnly
private java.lang.Boolean readOnly
transactionIsolation
private java.lang.Integer transactionIsolation
autoCommit
private java.lang.Boolean autoCommit
closed
private boolean closed
target
private java.sql.Connection target
LazyConnectionDataSourceProxy.LazyConnectionInvocationHandler
public LazyConnectionDataSourceProxy.LazyConnectionInvocationHandler()
LazyConnectionDataSourceProxy.LazyConnectionInvocationHandler
public LazyConnectionDataSourceProxy.LazyConnectionInvocationHandler(java.lang.String username,
java.lang.String password)
invoke
public java.lang.Object invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
throws java.lang.Throwable
- Specified by:
invoke
in interface java.lang.reflect.InvocationHandler
- Throws:
java.lang.Throwable
hasTargetConnection
private boolean hasTargetConnection()
- Return whether the proxy currently holds a target Connection.
getTargetConnection
private java.sql.Connection getTargetConnection(java.lang.reflect.Method operation)
throws java.sql.SQLException
- Return the target Connection, fetching it and initializing it if necessary.
- Throws:
java.sql.SQLException