|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
PreparedStatementMeasure.java | - | 0% | 0% | 0% |
|
1 |
/*
|
|
2 |
* Joey and its relative products are published under the terms
|
|
3 |
* of the Apache Software License.
|
|
4 |
*/
|
|
5 |
package org.asyrinx.brownie.jdbc.measure;
|
|
6 |
|
|
7 |
import java.io.InputStream;
|
|
8 |
import java.io.Reader;
|
|
9 |
import java.math.BigDecimal;
|
|
10 |
import java.net.URL;
|
|
11 |
import java.sql.Array;
|
|
12 |
import java.sql.Blob;
|
|
13 |
import java.sql.Clob;
|
|
14 |
import java.sql.Date;
|
|
15 |
import java.sql.ParameterMetaData;
|
|
16 |
import java.sql.PreparedStatement;
|
|
17 |
import java.sql.Ref;
|
|
18 |
import java.sql.ResultSet;
|
|
19 |
import java.sql.ResultSetMetaData;
|
|
20 |
import java.sql.SQLException;
|
|
21 |
import java.sql.Time;
|
|
22 |
import java.sql.Timestamp;
|
|
23 |
import java.util.Calendar;
|
|
24 |
|
|
25 |
import org.asyrinx.brownie.core.log.MeasureLog;
|
|
26 |
|
|
27 |
/**
|
|
28 |
* @author Akima
|
|
29 |
*/
|
|
30 |
public class PreparedStatementMeasure extends StatementMeasure implements |
|
31 |
PreparedStatement { |
|
32 |
|
|
33 |
/**
|
|
34 |
* Constructor for PreparedStatementMeasure.
|
|
35 |
*
|
|
36 |
* @param source
|
|
37 |
* @param log
|
|
38 |
*/
|
|
39 | 0 |
public PreparedStatementMeasure(PreparedStatement source, Object key,
|
40 |
MeasureLog measureLog) { |
|
41 | 0 |
super(source, measureLog);
|
42 | 0 |
this.source = source;
|
43 | 0 |
this.keyName = String.valueOf(key);
|
44 |
} |
|
45 |
|
|
46 |
/**
|
|
47 |
* Constructor for PreparedStatementMeasure.
|
|
48 |
*
|
|
49 |
* @param source
|
|
50 |
*/
|
|
51 | 0 |
public PreparedStatementMeasure(PreparedStatement source, Object key) {
|
52 | 0 |
this(source, key, null); |
53 |
} |
|
54 |
|
|
55 |
private final PreparedStatement source;
|
|
56 |
|
|
57 |
private final String keyName;
|
|
58 |
|
|
59 |
/**
|
|
60 |
* @see java.sql.PreparedStatement#addBatch()
|
|
61 |
*/
|
|
62 | 0 |
public void addBatch() throws SQLException { |
63 | 0 |
source.addBatch(); |
64 |
} |
|
65 |
|
|
66 |
/**
|
|
67 |
* @see java.sql.PreparedStatement#clearParameters()
|
|
68 |
*/
|
|
69 | 0 |
public void clearParameters() throws SQLException { |
70 | 0 |
source.clearParameters(); |
71 |
} |
|
72 |
|
|
73 |
/**
|
|
74 |
* @see java.sql.PreparedStatement#execute()
|
|
75 |
*/
|
|
76 | 0 |
public boolean execute() throws SQLException { |
77 | 0 |
measureLog.reset(); |
78 | 0 |
boolean result = source.execute();
|
79 | 0 |
measureLog.done(keyName); |
80 | 0 |
return result;
|
81 |
} |
|
82 |
|
|
83 |
/**
|
|
84 |
* @see java.sql.PreparedStatement#executeUpdate()
|
|
85 |
*/
|
|
86 | 0 |
public int executeUpdate() throws SQLException { |
87 | 0 |
measureLog.reset(); |
88 | 0 |
int result = source.executeUpdate();
|
89 | 0 |
measureLog.done(keyName); |
90 | 0 |
return result;
|
91 |
} |
|
92 |
|
|
93 |
/**
|
|
94 |
* @see java.sql.PreparedStatement#executeQuery()
|
|
95 |
*/
|
|
96 | 0 |
public ResultSet executeQuery() throws SQLException { |
97 | 0 |
measureLog.reset(); |
98 | 0 |
ResultSet result = source.executeQuery(); |
99 | 0 |
measureLog.done(keyName); |
100 | 0 |
return result;
|
101 |
} |
|
102 |
|
|
103 |
/**
|
|
104 |
* @see java.sql.PreparedStatement#setBigDecimal(int, BigDecimal)
|
|
105 |
*/
|
|
106 | 0 |
public void setBigDecimal(int parameterIndex, BigDecimal x) |
107 |
throws SQLException {
|
|
108 | 0 |
source.setBigDecimal(parameterIndex, x); |
109 |
} |
|
110 |
|
|
111 |
/**
|
|
112 |
* @see java.sql.PreparedStatement#setBoolean(int, boolean)
|
|
113 |
*/
|
|
114 | 0 |
public void setBoolean(int parameterIndex, boolean x) throws SQLException { |
115 | 0 |
source.setBoolean(parameterIndex, x); |
116 |
} |
|
117 |
|
|
118 |
/**
|
|
119 |
* @see java.sql.PreparedStatement#setBytes(int, byte[])
|
|
120 |
*/
|
|
121 | 0 |
public void setBytes(int parameterIndex, byte[] x) throws SQLException { |
122 | 0 |
source.setBytes(parameterIndex, x); |
123 |
} |
|
124 |
|
|
125 |
/**
|
|
126 |
* @see java.sql.PreparedStatement#setDate(int, Date)
|
|
127 |
*/
|
|
128 | 0 |
public void setDate(int parameterIndex, Date x) throws SQLException { |
129 | 0 |
source.setDate(parameterIndex, x); |
130 |
} |
|
131 |
|
|
132 |
/**
|
|
133 |
* @see java.sql.PreparedStatement#setDate(int, Date, Calendar)
|
|
134 |
*/
|
|
135 | 0 |
public void setDate(int parameterIndex, Date x, Calendar cal) |
136 |
throws SQLException {
|
|
137 | 0 |
source.setDate(parameterIndex, x, cal); |
138 |
} |
|
139 |
|
|
140 |
/**
|
|
141 |
* @see java.sql.PreparedStatement#setDouble(int, double)
|
|
142 |
*/
|
|
143 | 0 |
public void setDouble(int parameterIndex, double x) throws SQLException { |
144 | 0 |
source.setDouble(parameterIndex, x); |
145 |
} |
|
146 |
|
|
147 |
/**
|
|
148 |
* @see java.sql.PreparedStatement#setFloat(int, float)
|
|
149 |
*/
|
|
150 | 0 |
public void setFloat(int parameterIndex, float x) throws SQLException { |
151 | 0 |
source.setFloat(parameterIndex, x); |
152 |
} |
|
153 |
|
|
154 |
/**
|
|
155 |
* @see java.sql.PreparedStatement#setInt(int, int)
|
|
156 |
*/
|
|
157 | 0 |
public void setInt(int parameterIndex, int x) throws SQLException { |
158 | 0 |
source.setInt(parameterIndex, x); |
159 |
} |
|
160 |
|
|
161 |
/**
|
|
162 |
* @see java.sql.PreparedStatement#setLong(int, long)
|
|
163 |
*/
|
|
164 | 0 |
public void setLong(int parameterIndex, long x) throws SQLException { |
165 | 0 |
source.setLong(parameterIndex, x); |
166 |
} |
|
167 |
|
|
168 |
/**
|
|
169 |
* @see java.sql.PreparedStatement#setNull(int, int)
|
|
170 |
*/
|
|
171 | 0 |
public void setNull(int parameterIndex, int sqlType) throws SQLException { |
172 | 0 |
source.setNull(parameterIndex, sqlType); |
173 |
} |
|
174 |
|
|
175 |
/**
|
|
176 |
* @see java.sql.PreparedStatement#setNull(int, int, String)
|
|
177 |
*/
|
|
178 | 0 |
public void setNull(int paramIndex, int sqlType, String typeName) |
179 |
throws SQLException {
|
|
180 | 0 |
source.setNull(paramIndex, sqlType, typeName); |
181 |
} |
|
182 |
|
|
183 |
/**
|
|
184 |
* @see java.sql.PreparedStatement#setObject(int, Object)
|
|
185 |
*/
|
|
186 | 0 |
public void setObject(int parameterIndex, Object x) throws SQLException { |
187 | 0 |
source.setObject(parameterIndex, x); |
188 |
} |
|
189 |
|
|
190 |
/**
|
|
191 |
* @see java.sql.PreparedStatement#setObject(int, Object, int)
|
|
192 |
*/
|
|
193 | 0 |
public void setObject(int parameterIndex, Object x, int targetSqlType) |
194 |
throws SQLException {
|
|
195 | 0 |
source.setObject(parameterIndex, x, targetSqlType); |
196 |
} |
|
197 |
|
|
198 |
/**
|
|
199 |
* @see java.sql.PreparedStatement#setObject(int, Object, int, int)
|
|
200 |
*/
|
|
201 | 0 |
public void setObject(int parameterIndex, Object x, int targetSqlType, |
202 |
int scale) throws SQLException { |
|
203 | 0 |
source.setObject(parameterIndex, x, targetSqlType, scale); |
204 |
} |
|
205 |
|
|
206 |
/**
|
|
207 |
* @see java.sql.PreparedStatement#setShort(int, short)
|
|
208 |
*/
|
|
209 | 0 |
public void setShort(int parameterIndex, short x) throws SQLException { |
210 | 0 |
source.setShort(parameterIndex, x); |
211 |
} |
|
212 |
|
|
213 |
/**
|
|
214 |
* @see java.sql.PreparedStatement#setString(int, String)
|
|
215 |
*/
|
|
216 | 0 |
public void setString(int parameterIndex, String x) throws SQLException { |
217 | 0 |
source.setString(parameterIndex, x); |
218 |
} |
|
219 |
|
|
220 |
/**
|
|
221 |
* @see java.sql.PreparedStatement#setTime(int, Time)
|
|
222 |
*/
|
|
223 | 0 |
public void setTime(int parameterIndex, Time x) throws SQLException { |
224 | 0 |
source.setTime(parameterIndex, x); |
225 |
} |
|
226 |
|
|
227 |
/**
|
|
228 |
* @see java.sql.PreparedStatement#setTime(int, Time, Calendar)
|
|
229 |
*/
|
|
230 | 0 |
public void setTime(int parameterIndex, Time x, Calendar cal) |
231 |
throws SQLException {
|
|
232 | 0 |
source.setTime(parameterIndex, x, cal); |
233 |
} |
|
234 |
|
|
235 |
/**
|
|
236 |
* @see java.sql.PreparedStatement#setTimestamp(int, Timestamp)
|
|
237 |
*/
|
|
238 | 0 |
public void setTimestamp(int parameterIndex, Timestamp x) |
239 |
throws SQLException {
|
|
240 | 0 |
source.setTimestamp(parameterIndex, x); |
241 |
} |
|
242 |
|
|
243 |
/**
|
|
244 |
* @see java.sql.PreparedStatement#setTimestamp(int, Timestamp, Calendar)
|
|
245 |
*/
|
|
246 | 0 |
public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) |
247 |
throws SQLException {
|
|
248 | 0 |
source.setTimestamp(parameterIndex, x, cal); |
249 |
} |
|
250 |
|
|
251 |
/**
|
|
252 |
* @see java.sql.PreparedStatement#setArray(int, Array)
|
|
253 |
*/
|
|
254 | 0 |
public void setArray(int i, Array x) throws SQLException { |
255 | 0 |
source.setArray(i, x); |
256 |
} |
|
257 |
|
|
258 |
/**
|
|
259 |
* @see java.sql.PreparedStatement#setAsciiStream(int, InputStream, int)
|
|
260 |
*/
|
|
261 | 0 |
public void setAsciiStream(int parameterIndex, InputStream x, int length) |
262 |
throws SQLException {
|
|
263 | 0 |
source.setAsciiStream(parameterIndex, x, length); |
264 |
} |
|
265 |
|
|
266 |
/**
|
|
267 |
* @see java.sql.PreparedStatement#setBinaryStream(int, InputStream, int)
|
|
268 |
*/
|
|
269 | 0 |
public void setBinaryStream(int parameterIndex, InputStream x, int length) |
270 |
throws SQLException {
|
|
271 | 0 |
source.setBinaryStream(parameterIndex, x, length); |
272 |
} |
|
273 |
|
|
274 |
/**
|
|
275 |
* @see java.sql.PreparedStatement#setBlob(int, Blob)
|
|
276 |
*/
|
|
277 | 0 |
public void setBlob(int i, Blob x) throws SQLException { |
278 | 0 |
source.setBlob(i, x); |
279 |
} |
|
280 |
|
|
281 |
/**
|
|
282 |
* @see java.sql.PreparedStatement#setByte(int, byte)
|
|
283 |
*/
|
|
284 | 0 |
public void setByte(int parameterIndex, byte x) throws SQLException { |
285 | 0 |
source.setByte(parameterIndex, x); |
286 |
} |
|
287 |
|
|
288 |
/**
|
|
289 |
* @see java.sql.PreparedStatement#setCharacterStream(int, Reader, int)
|
|
290 |
*/
|
|
291 | 0 |
public void setCharacterStream(int parameterIndex, Reader reader, int length) |
292 |
throws SQLException {
|
|
293 | 0 |
source.setCharacterStream(parameterIndex, reader, length); |
294 |
} |
|
295 |
|
|
296 |
/**
|
|
297 |
* @see java.sql.PreparedStatement#setClob(int, Clob)
|
|
298 |
*/
|
|
299 | 0 |
public void setClob(int i, Clob x) throws SQLException { |
300 | 0 |
source.setClob(i, x); |
301 |
} |
|
302 |
|
|
303 |
/**
|
|
304 |
* @see java.sql.PreparedStatement#setRef(int, Ref)
|
|
305 |
*/
|
|
306 | 0 |
public void setRef(int i, Ref x) throws SQLException { |
307 | 0 |
source.setRef(i, x); |
308 |
} |
|
309 |
|
|
310 |
/**
|
|
311 |
* @see java.sql.PreparedStatement#setUnicodeStream(int, InputStream, int)
|
|
312 |
* @deprecated
|
|
313 |
*/
|
|
314 | 0 |
public void setUnicodeStream(int parameterIndex, InputStream x, int length) |
315 |
throws SQLException {
|
|
316 |
//source.setUnicodeStream(parameterIndex, x, length);
|
|
317 |
//params.add(parameterIndex, x);
|
|
318 |
} |
|
319 |
|
|
320 |
/**
|
|
321 |
* @see java.sql.PreparedStatement#getMetaData()
|
|
322 |
*/
|
|
323 | 0 |
public ResultSetMetaData getMetaData() throws SQLException { |
324 | 0 |
return source.getMetaData();
|
325 |
} |
|
326 |
|
|
327 |
/**
|
|
328 |
* @return @throws
|
|
329 |
* java.sql.SQLException
|
|
330 |
*/
|
|
331 | 0 |
public ParameterMetaData getParameterMetaData() throws SQLException { |
332 | 0 |
return source.getParameterMetaData();
|
333 |
} |
|
334 |
|
|
335 |
/**
|
|
336 |
* @param parameterIndex
|
|
337 |
* @param x
|
|
338 |
* @throws java.sql.SQLException
|
|
339 |
*/
|
|
340 | 0 |
public void setURL(int parameterIndex, URL x) throws SQLException { |
341 | 0 |
source.setURL(parameterIndex, x); |
342 |
} |
|
343 |
|
|
344 |
} |
|