private Object addBatch ( Object implObject , Method method , Object [ ] args ) throws IllegalAccessException , IllegalArgumentException , InvocationTargetException , SQLException { Object sqljPstmt = args [ 0 ] ; final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "addBatch" , new Object [ ] { this , AdapterUtil . toString ( sqljPstmt ) } ) ; // Get underlying instance of SQLJPreparedStatement from dynamic proxy // to avoid java.lang.ClassCastException in addBatch() if ( sqljPstmt != null && Proxy . isProxyClass ( sqljPstmt . getClass ( ) ) ) { InvocationHandler handler = Proxy . getInvocationHandler ( sqljPstmt ) ; if ( handler instanceof WSJdbcWrapper ) args = new Object [ ] { ( ( WSJdbcWrapper ) handler ) . getJDBCImplObject ( ) } ; } return method . invoke ( implObject , args ) ; }
Invokes addBatch after replacing the parameter with the DB2 impl object if proxied .