1
2
3
4
5
6
7
8
9
10
11 package it.imolinfo.jbi4cics.connection.jdbc.util;
12
13 import java.lang.reflect.Proxy;
14
15
16
17
18
19
20
21
22
23
24 public class DisconnectedStatementFactory {
25
26
27
28
29 public DisconnectedStatementFactory(){
30 super();
31 }
32
33 public static DisconnectedStatement createDisconnectedStatement(){
34 return (DisconnectedStatement)Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),new Class[]{DisconnectedStatement.class},new StatementInvocationHandler());
35 }
36
37 public static DisconnectedStatement createDisconnectedStatement(int resultSetType, int resultSetConcurrency){
38 return (DisconnectedStatement)Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),new Class[]{DisconnectedStatement.class},new StatementInvocationHandler(resultSetType,resultSetConcurrency));
39 }
40
41 public static DisconnectedStatement createDisconnectedStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability){
42 return (DisconnectedStatement)Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),new Class[]{DisconnectedStatement.class},new StatementInvocationHandler(resultSetType,resultSetConcurrency,resultSetHoldability));
43 }
44
45 public static DisconnectedPreparedStatement prepareDisconnectedStatement(String sql){
46 return (DisconnectedPreparedStatement)Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),new Class[]{DisconnectedPreparedStatement.class},new PreparedStatementInvocationHandler(sql));
47 }
48
49 public static DisconnectedPreparedStatement prepareDisconnectedStatement(String sql, int autoGeneratedKeys){
50 return (DisconnectedPreparedStatement)Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),new Class[]{DisconnectedPreparedStatement.class},new PreparedStatementInvocationHandler(sql, autoGeneratedKeys));
51 }
52
53 public static DisconnectedPreparedStatement prepareDisconnectedStatement(String sql, int[] columnIndexes){
54 return (DisconnectedPreparedStatement)Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),new Class[]{DisconnectedPreparedStatement.class},new PreparedStatementInvocationHandler(sql, columnIndexes));
55 }
56
57 public static DisconnectedPreparedStatement prepareDisconnectedStatement(String sql, int resultSetType, int resultSetConcurrency){
58 return (DisconnectedPreparedStatement)Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),new Class[]{DisconnectedPreparedStatement.class},new PreparedStatementInvocationHandler(sql, resultSetType, resultSetConcurrency));
59 }
60
61 public static DisconnectedPreparedStatement prepareDisconnectedStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability){
62 return (DisconnectedPreparedStatement)Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),new Class[]{DisconnectedPreparedStatement.class},new PreparedStatementInvocationHandler(sql, resultSetType, resultSetConcurrency, resultSetHoldability));
63 }
64
65 public static DisconnectedPreparedStatement prepareDisconnectedStatement(String sql, String[] columnNames){
66 return (DisconnectedPreparedStatement)Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),new Class[]{DisconnectedPreparedStatement.class},new PreparedStatementInvocationHandler(sql, columnNames));
67 }
68
69 public static DisconnectedCallableStatement prepareDisconnectedCall(String sql){
70 return (DisconnectedCallableStatement)Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),new Class[]{DisconnectedCallableStatement.class},new CallableStatementInvocationHandler(sql));
71 }
72
73 public static DisconnectedCallableStatement prepareDisconnectedCall(String sql, int resultSetType, int resultSetConcurrency){
74 return (DisconnectedCallableStatement)Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),new Class[]{DisconnectedCallableStatement.class},new CallableStatementInvocationHandler(sql,resultSetType,resultSetConcurrency));
75 }
76
77 public static DisconnectedCallableStatement prepareDisconnectedCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability){
78 return (DisconnectedCallableStatement)Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),new Class[]{DisconnectedCallableStatement.class},new CallableStatementInvocationHandler(sql,resultSetType,resultSetConcurrency,resultSetHoldability));
79 }
80
81
82 }