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 | 0 | { |
22 | 0 | this.statement = statement; |
23 | 0 | } |
24 | |
|
25 | |
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable |
26 | |
{ |
27 | |
try |
28 | |
{ |
29 | 0 | return method.invoke(statement, args); |
30 | |
} |
31 | 0 | catch (InvocationTargetException ex) |
32 | |
{ |
33 | 0 | throw ex.getCause(); |
34 | |
} |
35 | |
} |
36 | |
|
37 | |
} |