1 /* $Id: PooledPreparedStatement.java 94 2008-12-18 11:07:17Z dobashi $
\r
2 * created: 2005/06/17
\r
5 package com.lavans.luz2.sql.pool;
\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
32 public class PooledPreparedStatement extends PooledStatement implements
\r
34 private PreparedStatement st = null;
\r
36 public PooledPreparedStatement(PooledConnection con, PreparedStatement st){
\r
47 * @throws java.sql.SQLException
\r
49 public void setTimestamp(int arg0, Timestamp arg1, Calendar arg2)
\r
50 throws SQLException {
\r
51 st.setTimestamp(arg0, arg1, arg2);
\r
56 * @throws java.sql.SQLException
\r
58 public void setShort(int arg0, short arg1) throws SQLException {
\r
59 st.setShort(arg0, arg1);
\r
64 * @throws java.sql.SQLException
\r
66 public void setLong(int arg0, long arg1) throws SQLException {
\r
67 st.setLong(arg0, arg1);
\r
71 * @throws java.sql.SQLException
\r
73 public ResultSet executeQuery() throws SQLException {
\r
74 return st.executeQuery();
\r
79 * @throws java.sql.SQLException
\r
81 public void setString(int arg0, String arg1) throws SQLException {
\r
82 st.setString(arg0, arg1);
\r
89 * @throws java.sql.SQLException
\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
98 * @throws java.sql.SQLException
\r
100 public void setDate(int arg0, Date arg1) throws SQLException {
\r
101 st.setDate(arg0, arg1);
\r
107 * @throws java.sql.SQLException
\r
109 public void setAsciiStream(int arg0, InputStream arg1, int arg2)
\r
110 throws SQLException {
\r
111 st.setAsciiStream(arg0, arg1, arg2);
\r
117 * @throws java.sql.SQLException
\r
119 public void setNull(int arg0, int arg1, String arg2) throws SQLException {
\r
120 st.setNull(arg0, arg1, arg2);
\r
124 * @throws java.sql.SQLException
\r
126 public int executeUpdate() throws SQLException {
\r
127 return st.executeUpdate();
\r
133 * @throws java.sql.SQLException
\r
135 public void setDate(int arg0, Date arg1, Calendar arg2) throws SQLException {
\r
136 st.setDate(arg0, arg1, arg2);
\r
139 * @throws java.sql.SQLException
\r
141 public void clearParameters() throws SQLException {
\r
142 st.clearParameters();
\r
147 * @throws java.sql.SQLException
\r
149 public void setInt(int arg0, int arg1) throws SQLException {
\r
150 st.setInt(arg0, arg1);
\r
155 * @throws java.sql.SQLException
\r
157 public void setBytes(int arg0, byte[] arg1) throws SQLException {
\r
158 st.setBytes(arg0, arg1);
\r
164 * @throws java.sql.SQLException
\r
166 public void setCharacterStream(int arg0, Reader arg1, int arg2)
\r
167 throws SQLException {
\r
168 st.setCharacterStream(arg0, arg1, arg2);
\r
173 * @throws java.sql.SQLException
\r
175 public void setRef(int arg0, Ref arg1) throws SQLException {
\r
176 st.setRef(arg0, arg1);
\r
179 * @throws java.sql.SQLException
\r
181 public void addBatch() throws SQLException {
\r
187 * @throws java.sql.SQLException
\r
189 public void setDouble(int arg0, double arg1) throws SQLException {
\r
190 st.setDouble(arg0, arg1);
\r
195 * @throws java.sql.SQLException
\r
197 public void setNull(int arg0, int arg1) throws SQLException {
\r
198 st.setNull(arg0, arg1);
\r
203 * @throws java.sql.SQLException
\r
205 public void setURL(int arg0, URL arg1) throws SQLException {
\r
206 st.setURL(arg0, arg1);
\r
212 * @throws java.sql.SQLException
\r
214 public void setObject(int arg0, Object arg1, int arg2) throws SQLException {
\r
215 st.setObject(arg0, arg1, arg2);
\r
219 * @throws java.sql.SQLException
\r
221 public ParameterMetaData getParameterMetaData() throws SQLException {
\r
222 return st.getParameterMetaData();
\r
228 * @throws java.sql.SQLException
\r
230 public void setBinaryStream(int arg0, InputStream arg1, int arg2)
\r
231 throws SQLException {
\r
232 st.setBinaryStream(arg0, arg1, arg2);
\r
236 * @throws java.sql.SQLException
\r
238 public ResultSetMetaData getMetaData() throws SQLException {
\r
239 return st.getMetaData();
\r
244 * @throws java.sql.SQLException
\r
246 public void setBoolean(int arg0, boolean arg1) throws SQLException {
\r
247 st.setBoolean(arg0, arg1);
\r
251 * @throws java.sql.SQLException
\r
253 public boolean execute() throws SQLException {
\r
254 return st.execute();
\r
259 * @throws java.sql.SQLException
\r
261 public void setBlob(int arg0, Blob arg1) throws SQLException {
\r
262 st.setBlob(arg0, arg1);
\r
267 * @throws java.sql.SQLException
\r
269 public void setClob(int arg0, Clob arg1) throws SQLException {
\r
270 st.setClob(arg0, arg1);
\r
275 * @throws java.sql.SQLException
\r
277 public void setBigDecimal(int arg0, BigDecimal arg1) throws SQLException {
\r
278 st.setBigDecimal(arg0, arg1);
\r
283 * @throws java.sql.SQLException
\r
285 public void setFloat(int arg0, float arg1) throws SQLException {
\r
286 st.setFloat(arg0, arg1);
\r
291 * @throws java.sql.SQLException
\r
293 public void setTime(int arg0, Time arg1) throws SQLException {
\r
294 st.setTime(arg0, arg1);
\r
299 * @throws java.sql.SQLException
\r
301 public void setByte(int arg0, byte arg1) throws SQLException {
\r
302 st.setByte(arg0, arg1);
\r
308 * @throws java.sql.SQLException
\r
310 public void setTime(int arg0, Time arg1, Calendar arg2) throws SQLException {
\r
311 st.setTime(arg0, arg1, arg2);
\r
317 * @throws java.sql.SQLException
\r
320 public void setUnicodeStream(int arg0, InputStream arg1, int arg2)
\r
321 throws SQLException {
\r
322 st.setUnicodeStream(arg0, arg1, arg2);
\r
327 * @throws java.sql.SQLException
\r
329 public void setArray(int arg0, Array arg1) throws SQLException {
\r
330 st.setArray(arg0, arg1);
\r
335 * @throws java.sql.SQLException
\r
337 public void setObject(int arg0, Object arg1) throws SQLException {
\r
338 st.setObject(arg0, arg1);
\r
343 * @throws java.sql.SQLException
\r
345 public void setTimestamp(int arg0, Timestamp arg1) throws SQLException {
\r
346 st.setTimestamp(arg0, arg1);
\r
350 * @param parameterIndex
\r
353 * @throws SQLException
\r
354 * @see java.sql.PreparedStatement#setAsciiStream(int, java.io.InputStream, long)
\r
356 public void setAsciiStream(int parameterIndex, InputStream x, long length)
\r
357 throws SQLException {
\r
358 st.setAsciiStream(parameterIndex, x, length);
\r
362 * @param parameterIndex
\r
364 * @throws SQLException
\r
365 * @see java.sql.PreparedStatement#setAsciiStream(int, java.io.InputStream)
\r
367 public void setAsciiStream(int parameterIndex, InputStream x)
\r
368 throws SQLException {
\r
369 st.setAsciiStream(parameterIndex, x);
\r
373 * @param parameterIndex
\r
376 * @throws SQLException
\r
377 * @see java.sql.PreparedStatement#setBinaryStream(int, java.io.InputStream, long)
\r
379 public void setBinaryStream(int parameterIndex, InputStream x, long length)
\r
380 throws SQLException {
\r
381 st.setBinaryStream(parameterIndex, x, length);
\r
385 * @param parameterIndex
\r
387 * @throws SQLException
\r
388 * @see java.sql.PreparedStatement#setBinaryStream(int, java.io.InputStream)
\r
390 public void setBinaryStream(int parameterIndex, InputStream x)
\r
391 throws SQLException {
\r
392 st.setBinaryStream(parameterIndex, x);
\r
396 * @param parameterIndex
\r
397 * @param inputStream
\r
399 * @throws SQLException
\r
400 * @see java.sql.PreparedStatement#setBlob(int, java.io.InputStream, long)
\r
402 public void setBlob(int parameterIndex, InputStream inputStream, long length)
\r
403 throws SQLException {
\r
404 st.setBlob(parameterIndex, inputStream, length);
\r
408 * @param parameterIndex
\r
409 * @param inputStream
\r
410 * @throws SQLException
\r
411 * @see java.sql.PreparedStatement#setBlob(int, java.io.InputStream)
\r
413 public void setBlob(int parameterIndex, InputStream inputStream)
\r
414 throws SQLException {
\r
415 st.setBlob(parameterIndex, inputStream);
\r
419 * @param parameterIndex
\r
422 * @throws SQLException
\r
423 * @see java.sql.PreparedStatement#setCharacterStream(int, java.io.Reader, long)
\r
425 public void setCharacterStream(int parameterIndex, Reader reader,
\r
426 long length) throws SQLException {
\r
427 st.setCharacterStream(parameterIndex, reader, length);
\r
431 * @param parameterIndex
\r
433 * @throws SQLException
\r
434 * @see java.sql.PreparedStatement#setCharacterStream(int, java.io.Reader)
\r
436 public void setCharacterStream(int parameterIndex, Reader reader)
\r
437 throws SQLException {
\r
438 st.setCharacterStream(parameterIndex, reader);
\r
442 * @param parameterIndex
\r
445 * @throws SQLException
\r
446 * @see java.sql.PreparedStatement#setClob(int, java.io.Reader, long)
\r
448 public void setClob(int parameterIndex, Reader reader, long length)
\r
449 throws SQLException {
\r
450 st.setClob(parameterIndex, reader, length);
\r
454 * @param parameterIndex
\r
456 * @throws SQLException
\r
457 * @see java.sql.PreparedStatement#setClob(int, java.io.Reader)
\r
459 public void setClob(int parameterIndex, Reader reader) throws SQLException {
\r
460 st.setClob(parameterIndex, reader);
\r
464 * @param parameterIndex
\r
467 * @throws SQLException
\r
468 * @see java.sql.PreparedStatement#setNCharacterStream(int, java.io.Reader, long)
\r
470 public void setNCharacterStream(int parameterIndex, Reader value,
\r
471 long length) throws SQLException {
\r
472 st.setNCharacterStream(parameterIndex, value, length);
\r
476 * @param parameterIndex
\r
478 * @throws SQLException
\r
479 * @see java.sql.PreparedStatement#setNCharacterStream(int, java.io.Reader)
\r
481 public void setNCharacterStream(int parameterIndex, Reader value)
\r
482 throws SQLException {
\r
483 st.setNCharacterStream(parameterIndex, value);
\r
487 * @param parameterIndex
\r
489 * @throws SQLException
\r
490 * @see java.sql.PreparedStatement#setNClob(int, java.sql.NClob)
\r
492 public void setNClob(int parameterIndex, NClob value) throws SQLException {
\r
493 st.setNClob(parameterIndex, value);
\r
497 * @param parameterIndex
\r
500 * @throws SQLException
\r
501 * @see java.sql.PreparedStatement#setNClob(int, java.io.Reader, long)
\r
503 public void setNClob(int parameterIndex, Reader reader, long length)
\r
504 throws SQLException {
\r
505 st.setNClob(parameterIndex, reader, length);
\r
509 * @param parameterIndex
\r
511 * @throws SQLException
\r
512 * @see java.sql.PreparedStatement#setNClob(int, java.io.Reader)
\r
514 public void setNClob(int parameterIndex, Reader reader) throws SQLException {
\r
515 st.setNClob(parameterIndex, reader);
\r
519 * @param parameterIndex
\r
521 * @throws SQLException
\r
522 * @see java.sql.PreparedStatement#setNString(int, java.lang.String)
\r
524 public void setNString(int parameterIndex, String value)
\r
525 throws SQLException {
\r
526 st.setNString(parameterIndex, value);
\r
530 * @param parameterIndex
\r
532 * @throws SQLException
\r
533 * @see java.sql.PreparedStatement#setRowId(int, java.sql.RowId)
\r
535 public void setRowId(int parameterIndex, RowId x) throws SQLException {
\r
536 st.setRowId(parameterIndex, x);
\r
540 * @param parameterIndex
\r
542 * @throws SQLException
\r
543 * @see java.sql.PreparedStatement#setSQLXML(int, java.sql.SQLXML)
\r
545 public void setSQLXML(int parameterIndex, SQLXML xmlObject)
\r
546 throws SQLException {
\r
547 st.setSQLXML(parameterIndex, xmlObject);
\r
553 * @throws SQLException
\r
554 * @see java.sql.Wrapper#isWrapperFor(java.lang.Class)
\r
557 public boolean isWrapperFor(Class<?> iface) throws SQLException {
\r
558 return st.isWrapperFor(iface);
\r
565 * @throws SQLException
\r
566 * @see java.sql.Wrapper#unwrap(java.lang.Class)
\r
569 @SuppressWarnings("unchecked")
\r
570 public <T> T unwrap(Class<T> iface) throws SQLException {
\r