OSDN Git Service

import
[luz/luz.git] / luz2 / src / com / lavans / luz2 / sql / pool / PooledPreparedStatement.java
1 /* $Id: PooledPreparedStatement.java 94 2008-12-18 11:07:17Z dobashi $\r
2  * created: 2005/06/17\r
3  *\r
4  */\r
5 package com.lavans.luz2.sql.pool;\r
6 \r
7 import java.io.InputStream;\r
8 import java.io.Reader;\r
9 import java.math.BigDecimal;\r
10 import java.net.URL;\r
11 import java.sql.Array;\r
12 import java.sql.Blob;\r
13 import java.sql.Clob;\r
14 import java.sql.Date;\r
15 import java.sql.NClob;\r
16 import java.sql.ParameterMetaData;\r
17 import java.sql.PreparedStatement;\r
18 import java.sql.Ref;\r
19 import java.sql.ResultSet;\r
20 import java.sql.ResultSetMetaData;\r
21 import java.sql.RowId;\r
22 import java.sql.SQLException;\r
23 import java.sql.SQLXML;\r
24 import java.sql.Time;\r
25 import java.sql.Timestamp;\r
26 import java.util.Calendar;\r
27 \r
28 /**\r
29  * @author dobashi\r
30  *\r
31  */\r
32 public class PooledPreparedStatement extends PooledStatement implements\r
33                 PreparedStatement {\r
34         private PreparedStatement st = null;\r
35 \r
36         public PooledPreparedStatement(PooledConnection con, PreparedStatement st){\r
37                 super(con, st);\r
38                 this.st = st;\r
39         }\r
40 \r
41 \r
42 \r
43         /**\r
44          * @param arg0\r
45          * @param arg1\r
46          * @param arg2\r
47          * @throws java.sql.SQLException\r
48          */\r
49         public void setTimestamp(int arg0, Timestamp arg1, Calendar arg2)\r
50                         throws SQLException {\r
51                 st.setTimestamp(arg0, arg1, arg2);\r
52         }\r
53         /**\r
54          * @param arg0\r
55          * @param arg1\r
56          * @throws java.sql.SQLException\r
57          */\r
58         public void setShort(int arg0, short arg1) throws SQLException {\r
59                 st.setShort(arg0, arg1);\r
60         }\r
61         /**\r
62          * @param arg0\r
63          * @param arg1\r
64          * @throws java.sql.SQLException\r
65          */\r
66         public void setLong(int arg0, long arg1) throws SQLException {\r
67                 st.setLong(arg0, arg1);\r
68         }\r
69         /**\r
70          * @return\r
71          * @throws java.sql.SQLException\r
72          */\r
73         public ResultSet executeQuery() throws SQLException {\r
74                 return st.executeQuery();\r
75         }\r
76         /**\r
77          * @param arg0\r
78          * @param arg1\r
79          * @throws java.sql.SQLException\r
80          */\r
81         public void setString(int arg0, String arg1) throws SQLException {\r
82                 st.setString(arg0, arg1);\r
83         }\r
84         /**\r
85          * @param arg0\r
86          * @param arg1\r
87          * @param arg2\r
88          * @param arg3\r
89          * @throws java.sql.SQLException\r
90          */\r
91         public void setObject(int arg0, Object arg1, int arg2, int arg3)\r
92                         throws SQLException {\r
93                 st.setObject(arg0, arg1, arg2, arg3);\r
94         }\r
95         /**\r
96          * @param arg0\r
97          * @param arg1\r
98          * @throws java.sql.SQLException\r
99          */\r
100         public void setDate(int arg0, Date arg1) throws SQLException {\r
101                 st.setDate(arg0, arg1);\r
102         }\r
103         /**\r
104          * @param arg0\r
105          * @param arg1\r
106          * @param arg2\r
107          * @throws java.sql.SQLException\r
108          */\r
109         public void setAsciiStream(int arg0, InputStream arg1, int arg2)\r
110                         throws SQLException {\r
111                 st.setAsciiStream(arg0, arg1, arg2);\r
112         }\r
113         /**\r
114          * @param arg0\r
115          * @param arg1\r
116          * @param arg2\r
117          * @throws java.sql.SQLException\r
118          */\r
119         public void setNull(int arg0, int arg1, String arg2) throws SQLException {\r
120                 st.setNull(arg0, arg1, arg2);\r
121         }\r
122         /**\r
123          * @return\r
124          * @throws java.sql.SQLException\r
125          */\r
126         public int executeUpdate() throws SQLException {\r
127                 return st.executeUpdate();\r
128         }\r
129         /**\r
130          * @param arg0\r
131          * @param arg1\r
132          * @param arg2\r
133          * @throws java.sql.SQLException\r
134          */\r
135         public void setDate(int arg0, Date arg1, Calendar arg2) throws SQLException {\r
136                 st.setDate(arg0, arg1, arg2);\r
137         }\r
138         /**\r
139          * @throws java.sql.SQLException\r
140          */\r
141         public void clearParameters() throws SQLException {\r
142                 st.clearParameters();\r
143         }\r
144         /**\r
145          * @param arg0\r
146          * @param arg1\r
147          * @throws java.sql.SQLException\r
148          */\r
149         public void setInt(int arg0, int arg1) throws SQLException {\r
150                 st.setInt(arg0, arg1);\r
151         }\r
152         /**\r
153          * @param arg0\r
154          * @param arg1\r
155          * @throws java.sql.SQLException\r
156          */\r
157         public void setBytes(int arg0, byte[] arg1) throws SQLException {\r
158                 st.setBytes(arg0, arg1);\r
159         }\r
160         /**\r
161          * @param arg0\r
162          * @param arg1\r
163          * @param arg2\r
164          * @throws java.sql.SQLException\r
165          */\r
166         public void setCharacterStream(int arg0, Reader arg1, int arg2)\r
167                         throws SQLException {\r
168                 st.setCharacterStream(arg0, arg1, arg2);\r
169         }\r
170         /**\r
171          * @param arg0\r
172          * @param arg1\r
173          * @throws java.sql.SQLException\r
174          */\r
175         public void setRef(int arg0, Ref arg1) throws SQLException {\r
176                 st.setRef(arg0, arg1);\r
177         }\r
178         /**\r
179          * @throws java.sql.SQLException\r
180          */\r
181         public void addBatch() throws SQLException {\r
182                 st.addBatch();\r
183         }\r
184         /**\r
185          * @param arg0\r
186          * @param arg1\r
187          * @throws java.sql.SQLException\r
188          */\r
189         public void setDouble(int arg0, double arg1) throws SQLException {\r
190                 st.setDouble(arg0, arg1);\r
191         }\r
192         /**\r
193          * @param arg0\r
194          * @param arg1\r
195          * @throws java.sql.SQLException\r
196          */\r
197         public void setNull(int arg0, int arg1) throws SQLException {\r
198                 st.setNull(arg0, arg1);\r
199         }\r
200         /**\r
201          * @param arg0\r
202          * @param arg1\r
203          * @throws java.sql.SQLException\r
204          */\r
205         public void setURL(int arg0, URL arg1) throws SQLException {\r
206                 st.setURL(arg0, arg1);\r
207         }\r
208         /**\r
209          * @param arg0\r
210          * @param arg1\r
211          * @param arg2\r
212          * @throws java.sql.SQLException\r
213          */\r
214         public void setObject(int arg0, Object arg1, int arg2) throws SQLException {\r
215                 st.setObject(arg0, arg1, arg2);\r
216         }\r
217         /**\r
218          * @return\r
219          * @throws java.sql.SQLException\r
220          */\r
221         public ParameterMetaData getParameterMetaData() throws SQLException {\r
222                 return st.getParameterMetaData();\r
223         }\r
224         /**\r
225          * @param arg0\r
226          * @param arg1\r
227          * @param arg2\r
228          * @throws java.sql.SQLException\r
229          */\r
230         public void setBinaryStream(int arg0, InputStream arg1, int arg2)\r
231                         throws SQLException {\r
232                 st.setBinaryStream(arg0, arg1, arg2);\r
233         }\r
234         /**\r
235          * @return\r
236          * @throws java.sql.SQLException\r
237          */\r
238         public ResultSetMetaData getMetaData() throws SQLException {\r
239                 return st.getMetaData();\r
240         }\r
241         /**\r
242          * @param arg0\r
243          * @param arg1\r
244          * @throws java.sql.SQLException\r
245          */\r
246         public void setBoolean(int arg0, boolean arg1) throws SQLException {\r
247                 st.setBoolean(arg0, arg1);\r
248         }\r
249         /**\r
250          * @return\r
251          * @throws java.sql.SQLException\r
252          */\r
253         public boolean execute() throws SQLException {\r
254                 return st.execute();\r
255         }\r
256         /**\r
257          * @param arg0\r
258          * @param arg1\r
259          * @throws java.sql.SQLException\r
260          */\r
261         public void setBlob(int arg0, Blob arg1) throws SQLException {\r
262                 st.setBlob(arg0, arg1);\r
263         }\r
264         /**\r
265          * @param arg0\r
266          * @param arg1\r
267          * @throws java.sql.SQLException\r
268          */\r
269         public void setClob(int arg0, Clob arg1) throws SQLException {\r
270                 st.setClob(arg0, arg1);\r
271         }\r
272         /**\r
273          * @param arg0\r
274          * @param arg1\r
275          * @throws java.sql.SQLException\r
276          */\r
277         public void setBigDecimal(int arg0, BigDecimal arg1) throws SQLException {\r
278                 st.setBigDecimal(arg0, arg1);\r
279         }\r
280         /**\r
281          * @param arg0\r
282          * @param arg1\r
283          * @throws java.sql.SQLException\r
284          */\r
285         public void setFloat(int arg0, float arg1) throws SQLException {\r
286                 st.setFloat(arg0, arg1);\r
287         }\r
288         /**\r
289          * @param arg0\r
290          * @param arg1\r
291          * @throws java.sql.SQLException\r
292          */\r
293         public void setTime(int arg0, Time arg1) throws SQLException {\r
294                 st.setTime(arg0, arg1);\r
295         }\r
296         /**\r
297          * @param arg0\r
298          * @param arg1\r
299          * @throws java.sql.SQLException\r
300          */\r
301         public void setByte(int arg0, byte arg1) throws SQLException {\r
302                 st.setByte(arg0, arg1);\r
303         }\r
304         /**\r
305          * @param arg0\r
306          * @param arg1\r
307          * @param arg2\r
308          * @throws java.sql.SQLException\r
309          */\r
310         public void setTime(int arg0, Time arg1, Calendar arg2) throws SQLException {\r
311                 st.setTime(arg0, arg1, arg2);\r
312         }\r
313         /**\r
314          * @param arg0\r
315          * @param arg1\r
316          * @param arg2\r
317          * @throws java.sql.SQLException\r
318          * @deprecated\r
319          */\r
320         public void setUnicodeStream(int arg0, InputStream arg1, int arg2)\r
321                         throws SQLException {\r
322                 st.setUnicodeStream(arg0, arg1, arg2);\r
323         }\r
324         /**\r
325          * @param arg0\r
326          * @param arg1\r
327          * @throws java.sql.SQLException\r
328          */\r
329         public void setArray(int arg0, Array arg1) throws SQLException {\r
330                 st.setArray(arg0, arg1);\r
331         }\r
332         /**\r
333          * @param arg0\r
334          * @param arg1\r
335          * @throws java.sql.SQLException\r
336          */\r
337         public void setObject(int arg0, Object arg1) throws SQLException {\r
338                 st.setObject(arg0, arg1);\r
339         }\r
340         /**\r
341          * @param arg0\r
342          * @param arg1\r
343          * @throws java.sql.SQLException\r
344          */\r
345         public void setTimestamp(int arg0, Timestamp arg1) throws SQLException {\r
346                 st.setTimestamp(arg0, arg1);\r
347         }\r
348 \r
349         /**\r
350          * @param parameterIndex\r
351          * @param x\r
352          * @param length\r
353          * @throws SQLException\r
354          * @see java.sql.PreparedStatement#setAsciiStream(int, java.io.InputStream, long)\r
355          */\r
356         public void setAsciiStream(int parameterIndex, InputStream x, long length)\r
357                         throws SQLException {\r
358                 st.setAsciiStream(parameterIndex, x, length);\r
359         }\r
360 \r
361         /**\r
362          * @param parameterIndex\r
363          * @param x\r
364          * @throws SQLException\r
365          * @see java.sql.PreparedStatement#setAsciiStream(int, java.io.InputStream)\r
366          */\r
367         public void setAsciiStream(int parameterIndex, InputStream x)\r
368                         throws SQLException {\r
369                 st.setAsciiStream(parameterIndex, x);\r
370         }\r
371 \r
372         /**\r
373          * @param parameterIndex\r
374          * @param x\r
375          * @param length\r
376          * @throws SQLException\r
377          * @see java.sql.PreparedStatement#setBinaryStream(int, java.io.InputStream, long)\r
378          */\r
379         public void setBinaryStream(int parameterIndex, InputStream x, long length)\r
380                         throws SQLException {\r
381                 st.setBinaryStream(parameterIndex, x, length);\r
382         }\r
383 \r
384         /**\r
385          * @param parameterIndex\r
386          * @param x\r
387          * @throws SQLException\r
388          * @see java.sql.PreparedStatement#setBinaryStream(int, java.io.InputStream)\r
389          */\r
390         public void setBinaryStream(int parameterIndex, InputStream x)\r
391                         throws SQLException {\r
392                 st.setBinaryStream(parameterIndex, x);\r
393         }\r
394 \r
395         /**\r
396          * @param parameterIndex\r
397          * @param inputStream\r
398          * @param length\r
399          * @throws SQLException\r
400          * @see java.sql.PreparedStatement#setBlob(int, java.io.InputStream, long)\r
401          */\r
402         public void setBlob(int parameterIndex, InputStream inputStream, long length)\r
403                         throws SQLException {\r
404                 st.setBlob(parameterIndex, inputStream, length);\r
405         }\r
406 \r
407         /**\r
408          * @param parameterIndex\r
409          * @param inputStream\r
410          * @throws SQLException\r
411          * @see java.sql.PreparedStatement#setBlob(int, java.io.InputStream)\r
412          */\r
413         public void setBlob(int parameterIndex, InputStream inputStream)\r
414                         throws SQLException {\r
415                 st.setBlob(parameterIndex, inputStream);\r
416         }\r
417 \r
418         /**\r
419          * @param parameterIndex\r
420          * @param reader\r
421          * @param length\r
422          * @throws SQLException\r
423          * @see java.sql.PreparedStatement#setCharacterStream(int, java.io.Reader, long)\r
424          */\r
425         public void setCharacterStream(int parameterIndex, Reader reader,\r
426                         long length) throws SQLException {\r
427                 st.setCharacterStream(parameterIndex, reader, length);\r
428         }\r
429 \r
430         /**\r
431          * @param parameterIndex\r
432          * @param reader\r
433          * @throws SQLException\r
434          * @see java.sql.PreparedStatement#setCharacterStream(int, java.io.Reader)\r
435          */\r
436         public void setCharacterStream(int parameterIndex, Reader reader)\r
437                         throws SQLException {\r
438                 st.setCharacterStream(parameterIndex, reader);\r
439         }\r
440 \r
441         /**\r
442          * @param parameterIndex\r
443          * @param reader\r
444          * @param length\r
445          * @throws SQLException\r
446          * @see java.sql.PreparedStatement#setClob(int, java.io.Reader, long)\r
447          */\r
448         public void setClob(int parameterIndex, Reader reader, long length)\r
449                         throws SQLException {\r
450                 st.setClob(parameterIndex, reader, length);\r
451         }\r
452 \r
453         /**\r
454          * @param parameterIndex\r
455          * @param reader\r
456          * @throws SQLException\r
457          * @see java.sql.PreparedStatement#setClob(int, java.io.Reader)\r
458          */\r
459         public void setClob(int parameterIndex, Reader reader) throws SQLException {\r
460                 st.setClob(parameterIndex, reader);\r
461         }\r
462 \r
463         /**\r
464          * @param parameterIndex\r
465          * @param value\r
466          * @param length\r
467          * @throws SQLException\r
468          * @see java.sql.PreparedStatement#setNCharacterStream(int, java.io.Reader, long)\r
469          */\r
470         public void setNCharacterStream(int parameterIndex, Reader value,\r
471                         long length) throws SQLException {\r
472                 st.setNCharacterStream(parameterIndex, value, length);\r
473         }\r
474 \r
475         /**\r
476          * @param parameterIndex\r
477          * @param value\r
478          * @throws SQLException\r
479          * @see java.sql.PreparedStatement#setNCharacterStream(int, java.io.Reader)\r
480          */\r
481         public void setNCharacterStream(int parameterIndex, Reader value)\r
482                         throws SQLException {\r
483                 st.setNCharacterStream(parameterIndex, value);\r
484         }\r
485 \r
486         /**\r
487          * @param parameterIndex\r
488          * @param value\r
489          * @throws SQLException\r
490          * @see java.sql.PreparedStatement#setNClob(int, java.sql.NClob)\r
491          */\r
492         public void setNClob(int parameterIndex, NClob value) throws SQLException {\r
493                 st.setNClob(parameterIndex, value);\r
494         }\r
495 \r
496         /**\r
497          * @param parameterIndex\r
498          * @param reader\r
499          * @param length\r
500          * @throws SQLException\r
501          * @see java.sql.PreparedStatement#setNClob(int, java.io.Reader, long)\r
502          */\r
503         public void setNClob(int parameterIndex, Reader reader, long length)\r
504                         throws SQLException {\r
505                 st.setNClob(parameterIndex, reader, length);\r
506         }\r
507 \r
508         /**\r
509          * @param parameterIndex\r
510          * @param reader\r
511          * @throws SQLException\r
512          * @see java.sql.PreparedStatement#setNClob(int, java.io.Reader)\r
513          */\r
514         public void setNClob(int parameterIndex, Reader reader) throws SQLException {\r
515                 st.setNClob(parameterIndex, reader);\r
516         }\r
517 \r
518         /**\r
519          * @param parameterIndex\r
520          * @param value\r
521          * @throws SQLException\r
522          * @see java.sql.PreparedStatement#setNString(int, java.lang.String)\r
523          */\r
524         public void setNString(int parameterIndex, String value)\r
525                         throws SQLException {\r
526                 st.setNString(parameterIndex, value);\r
527         }\r
528 \r
529         /**\r
530          * @param parameterIndex\r
531          * @param x\r
532          * @throws SQLException\r
533          * @see java.sql.PreparedStatement#setRowId(int, java.sql.RowId)\r
534          */\r
535         public void setRowId(int parameterIndex, RowId x) throws SQLException {\r
536                 st.setRowId(parameterIndex, x);\r
537         }\r
538 \r
539         /**\r
540          * @param parameterIndex\r
541          * @param xmlObject\r
542          * @throws SQLException\r
543          * @see java.sql.PreparedStatement#setSQLXML(int, java.sql.SQLXML)\r
544          */\r
545         public void setSQLXML(int parameterIndex, SQLXML xmlObject)\r
546                         throws SQLException {\r
547                 st.setSQLXML(parameterIndex, xmlObject);\r
548         }\r
549 \r
550         /**\r
551          * @param iface\r
552          * @return\r
553          * @throws SQLException\r
554          * @see java.sql.Wrapper#isWrapperFor(java.lang.Class)\r
555          */\r
556         @Override\r
557         public boolean isWrapperFor(Class<?> iface) throws SQLException {\r
558                 return st.isWrapperFor(iface);\r
559         }\r
560 \r
561         /**\r
562          * @param <T>\r
563          * @param iface\r
564          * @return\r
565          * @throws SQLException\r
566          * @see java.sql.Wrapper#unwrap(java.lang.Class)\r
567          */\r
568         @Override\r
569         @SuppressWarnings("unchecked")\r
570         public <T> T unwrap(Class<T> iface) throws SQLException {\r
571                 return (T)this;\r
572         }\r
573 }\r