it.imolinfo.jbi4cics.connection.jdbc.util
Class CallableStatementInvocationHandler
java.lang.Object
it.imolinfo.jbi4cics.connection.jdbc.util.CallableStatementInvocationHandler
- All Implemented Interfaces:
- java.lang.reflect.InvocationHandler
public class CallableStatementInvocationHandler
- extends java.lang.Object
- Author:
- raffaele
Method Summary |
protected java.sql.Statement |
createStatement()
Metodo un po' complicato per capire quale era il costruttore e riprodure esattamente il comportamento desiderato. |
java.sql.Connection |
getConnection()
|
java.sql.Statement |
getUnderlyingStatement()
|
java.lang.Object |
handleExecute(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
|
java.lang.Object |
handleGet(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
|
java.lang.Object |
handleOtherMethods(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
|
java.lang.Object |
handleSet(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
|
java.lang.Object |
invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
La gestione e' simile a quella degli altri statement, ma in questo caso bisogna aggiungere
la gestione dei parametri della stored procedur. |
protected java.lang.Object |
invokeMethod(java.lang.reflect.Method method,
java.lang.Object[] args)
|
boolean |
isConnected()
|
void |
setConnected(boolean connected)
|
void |
setConnection(java.sql.Connection conn)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
sql
protected java.lang.String sql
autoGeneratedKeys
protected int autoGeneratedKeys
columnIndexes
protected int[] columnIndexes
columnNames
protected java.lang.String[] columnNames
resultSetType
protected int resultSetType
resultSetConcurrency
protected int resultSetConcurrency
resultSetHoldability
protected int resultSetHoldability
CallableStatementInvocationHandler
public CallableStatementInvocationHandler(java.lang.String sql)
- Parameters:
sql
- The SQL
CallableStatementInvocationHandler
public CallableStatementInvocationHandler(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
- Parameters:
sql
- The SQLresultSetType
- The result set typeresultSetConcurrency
- The result set Councurrency
CallableStatementInvocationHandler
public CallableStatementInvocationHandler(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
- Parameters:
sql
- The SQLresultSetType
- The result set typeresultSetConcurrency
- The result set CouncurrencyresultSetHoldability
- The result set Holdability
createStatement
protected java.sql.Statement createStatement()
throws java.sql.SQLException
- Metodo un po' complicato per capire quale era il costruttore e riprodure esattamente il comportamento desiderato.
- Returns:
- The create statement
- Throws:
java.sql.SQLException
- The SQL exception
invoke
public java.lang.Object invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
throws java.lang.Throwable
- La gestione e' simile a quella degli altri statement, ma in questo caso bisogna aggiungere
la gestione dei parametri della stored procedur. In particolare e' importante gestire gli outparameter.
- Specified by:
invoke
in interface java.lang.reflect.InvocationHandler
- Parameters:
proxy
- The proxymethod
- The methodargs
- The args
- Returns:
- object The invoked object
- Throws:
java.lang.Throwable
- The Throwable
handleGet
public java.lang.Object handleGet(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
handleSet
public java.lang.Object handleSet(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
handleExecute
public java.lang.Object handleExecute(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
handleOtherMethods
public java.lang.Object handleOtherMethods(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
getConnection
public java.sql.Connection getConnection()
- Returns:
- Returns the connection.
setConnection
public void setConnection(java.sql.Connection conn)
- Parameters:
conn
- The connection to set.
isConnected
public boolean isConnected()
- Returns:
- Returns the connected.
setConnected
public void setConnected(boolean connected)
throws java.sql.SQLException
- Parameters:
connected
- The connected to set.
- Throws:
java.sql.SQLException
- The SQL exception
invokeMethod
protected java.lang.Object invokeMethod(java.lang.reflect.Method method,
java.lang.Object[] args)
throws java.sql.SQLException
- Parameters:
method
- The methodargs
- The args
- Returns:
- Object The invoked method
- Throws:
java.sql.SQLException
- The SQL Exception
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
- Returns:
- A string
getUnderlyingStatement
public java.sql.Statement getUnderlyingStatement()
- Returns:
- Returns the underlyingStatement.
Copyright © 2005-2008 Imola Informatica. All Rights Reserved.