1
2 package com.opensourceconnections.msjdbcproxy;
3
4 import java.sql.Connection;
5 import java.sql.ResultSet;
6 import java.sql.SQLException;
7 import java.sql.SQLWarning;
8 import java.sql.Statement;
9
10 public class StatementProxy implements Statement
11 {
12 protected final ConnectionProxy _connection;
13 protected final Statement _statement;
14
15 public StatementProxy(ConnectionProxy connection, Statement statement)
16 {
17 _connection = connection;
18 _statement = statement;
19 }
20
21 public ResultSet executeQuery(String sql) throws SQLException
22 {
23 return new ResultSetProxy(this, _statement.executeQuery(sql));
24 }
25
26 public int executeUpdate(String sql) throws SQLException
27 {
28 return _statement.executeUpdate(sql);
29 }
30
31 public void close() throws SQLException
32 {
33 _statement.close();
34 }
35
36 public int getMaxFieldSize() throws SQLException
37 {
38 return _statement.getMaxFieldSize();
39 }
40
41 public void setMaxFieldSize(int max) throws SQLException
42 {
43 _statement.setMaxFieldSize(max);
44 }
45
46 public int getMaxRows() throws SQLException
47 {
48 return _statement.getMaxRows();
49 }
50
51 public void setMaxRows(int max) throws SQLException
52 {
53 _statement.setMaxRows(max);
54 }
55
56 public void setEscapeProcessing(boolean enable) throws SQLException
57 {
58 _statement.setEscapeProcessing(enable);
59 }
60
61 public int getQueryTimeout() throws SQLException
62 {
63 return _statement.getQueryTimeout();
64 }
65
66 public void setQueryTimeout(int seconds) throws SQLException
67 {
68 _statement.setQueryTimeout(seconds);
69 }
70
71 public void cancel() throws SQLException
72 {
73 _statement.cancel();
74 }
75
76 public SQLWarning getWarnings() throws SQLException
77 {
78 return _statement.getWarnings();
79 }
80
81 public void clearWarnings() throws SQLException
82 {
83 _statement.clearWarnings();
84 }
85
86 public void setCursorName(String name) throws SQLException
87 {
88 _statement.setCursorName(name);
89 }
90
91 public boolean execute(String sql) throws SQLException
92 {
93 return _statement.execute(sql);
94 }
95
96 public ResultSet getResultSet() throws SQLException
97 {
98 return new ResultSetProxy(this, _statement.getResultSet());
99 }
100
101 public int getUpdateCount() throws SQLException
102 {
103 return _statement.getUpdateCount();
104 }
105
106 public boolean getMoreResults() throws SQLException
107 {
108 return _statement.getMoreResults();
109 }
110
111 public void setFetchDirection(int direction) throws SQLException
112 {
113 _statement.setFetchDirection(direction);
114 }
115
116 public int getFetchDirection() throws SQLException
117 {
118 return _statement.getFetchDirection();
119 }
120
121 public void setFetchSize(int rows) throws SQLException
122 {
123 _statement.setFetchSize(rows);
124 }
125
126 public int getFetchSize() throws SQLException
127 {
128 return _statement.getFetchSize();
129 }
130
131 public int getResultSetConcurrency() throws SQLException
132 {
133 return _statement.getResultSetConcurrency();
134 }
135
136 public int getResultSetType() throws SQLException
137 {
138 return _statement.getResultSetType();
139 }
140
141 public void addBatch(String sql) throws SQLException
142 {
143 _statement.addBatch(sql);
144 }
145
146 public void clearBatch() throws SQLException
147 {
148 _statement.clearBatch();
149 }
150
151 public int[] executeBatch() throws SQLException
152 {
153 return _statement.executeBatch();
154 }
155
156 public Connection getConnection() throws SQLException
157 {
158 return _connection;
159 }
160
161 public boolean getMoreResults(int current) throws SQLException
162 {
163 return _statement.getMoreResults(current);
164 }
165
166 public ResultSet getGeneratedKeys() throws SQLException
167 {
168 return new ResultSetProxy(this, _statement.getGeneratedKeys());
169 }
170
171 public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException
172 {
173 return _statement.executeUpdate(sql, autoGeneratedKeys);
174 }
175
176 public int executeUpdate(String sql, int columnIndexes[]) throws SQLException
177 {
178 return _statement.executeUpdate(sql, columnIndexes);
179 }
180
181 public int executeUpdate(String sql, String columnNames[]) throws SQLException
182 {
183 return _statement.executeUpdate(sql, columnNames);
184 }
185
186 public boolean execute(String sql, int autoGeneratedKeys) throws SQLException
187 {
188 return _statement.execute(sql, autoGeneratedKeys);
189 }
190
191 public boolean execute(String sql, int columnIndexes[]) throws SQLException
192 {
193 return _statement.execute(sql, columnIndexes);
194 }
195
196 public boolean execute(String sql, String columnNames[]) throws SQLException
197 {
198 return _statement.execute(sql, columnNames);
199 }
200
201 public int getResultSetHoldability() throws SQLException
202 {
203 return _statement.getResultSetHoldability();
204 }
205 }