1
2
3
4
5
6
7 package org.mule.transport.jdbc.xa;
8
9 import java.lang.reflect.InvocationHandler;
10 import java.lang.reflect.InvocationTargetException;
11 import java.lang.reflect.Method;
12 import java.sql.Statement;
13
14
15 public class StatementInvocationHandler implements InvocationHandler
16 {
17
18 private Statement statement;
19
20 public StatementInvocationHandler(ConnectionWrapper connectionWrapper, Statement statement)
21 {
22 this.statement = statement;
23 }
24
25 public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
26 {
27 try
28 {
29 return method.invoke(statement, args);
30 }
31 catch (InvocationTargetException ex)
32 {
33 throw ex.getCause();
34 }
35 }
36
37 }