001: /*
002: * Copyright (c) 1998 - 2005 Versant Corporation
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * Versant Corporation - initial API and implementation
010: */
011: package com.versant.core.jdbc.conn;
012:
013: import com.versant.core.logging.LogEventStore;
014: import com.versant.core.logging.LogEventStore;
015: import com.versant.core.logging.LogEventStore;
016:
017: import java.math.BigDecimal;
018: import java.sql.*;
019: import java.util.Calendar;
020: import java.util.Map;
021: import java.net.URL;
022: import java.io.InputStream;
023: import java.io.Reader;
024:
025: /**
026: * A JDBC CallableStatement wrapped for logging.
027: */
028: public final class LoggingCallableStatement extends
029: PooledPreparedStatement implements CallableStatement {
030:
031: protected CallableStatement cstat = null;
032:
033: public LoggingCallableStatement(LoggingConnection con,
034: CallableStatement statement, LogEventStore pes) {
035: super (con, statement, pes, null, null);
036: this .cstat = statement;
037: }
038:
039: public void registerOutParameter(int parameterIndex, int sqlType)
040: throws SQLException {
041: cstat.registerOutParameter(parameterIndex, sqlType);
042: }
043:
044: public void registerOutParameter(int parameterIndex, int sqlType,
045: int scale) throws SQLException {
046: cstat.registerOutParameter(parameterIndex, sqlType, scale);
047: }
048:
049: public boolean wasNull() throws SQLException {
050: return cstat.wasNull();
051: }
052:
053: public String getString(int parameterIndex) throws SQLException {
054: return cstat.getString(parameterIndex);
055: }
056:
057: public boolean getBoolean(int parameterIndex) throws SQLException {
058: return cstat.getBoolean(parameterIndex);
059: }
060:
061: public byte getByte(int parameterIndex) throws SQLException {
062: return cstat.getByte(parameterIndex);
063: }
064:
065: public short getShort(int parameterIndex) throws SQLException {
066: return cstat.getShort(parameterIndex);
067: }
068:
069: public int getInt(int parameterIndex) throws SQLException {
070: return cstat.getInt(parameterIndex);
071: }
072:
073: public long getLong(int parameterIndex) throws SQLException {
074: return cstat.getLong(parameterIndex);
075: }
076:
077: public float getFloat(int parameterIndex) throws SQLException {
078: return cstat.getFloat(parameterIndex);
079: }
080:
081: public double getDouble(int parameterIndex) throws SQLException {
082: return cstat.getDouble(parameterIndex);
083: }
084:
085: public BigDecimal getBigDecimal(int parameterIndex, int scale)
086: throws SQLException {
087: return cstat.getBigDecimal(parameterIndex, scale);
088: }
089:
090: public byte[] getBytes(int parameterIndex) throws SQLException {
091: return cstat.getBytes(parameterIndex);
092: }
093:
094: public Date getDate(int parameterIndex) throws SQLException {
095: return cstat.getDate(parameterIndex);
096: }
097:
098: public Time getTime(int parameterIndex) throws SQLException {
099: return cstat.getTime(parameterIndex);
100: }
101:
102: public Timestamp getTimestamp(int parameterIndex)
103: throws SQLException {
104: return cstat.getTimestamp(parameterIndex);
105: }
106:
107: public Object getObject(int parameterIndex) throws SQLException {
108: return cstat.getObject(parameterIndex);
109: }
110:
111: public BigDecimal getBigDecimal(int parameterIndex)
112: throws SQLException {
113: return cstat.getBigDecimal(parameterIndex);
114: }
115:
116: public Object getObject(int i, Map map) throws SQLException {
117: return cstat.getObject(i, map);
118: }
119:
120: public Ref getRef(int i) throws SQLException {
121: return cstat.getRef(i);
122: }
123:
124: public Blob getBlob(int i) throws SQLException {
125: return cstat.getBlob(i);
126: }
127:
128: public Clob getClob(int i) throws SQLException {
129: return cstat.getClob(i);
130: }
131:
132: public Array getArray(int i) throws SQLException {
133: return cstat.getArray(i);
134: }
135:
136: public Date getDate(int parameterIndex, Calendar cal)
137: throws SQLException {
138: return cstat.getDate(parameterIndex, cal);
139: }
140:
141: public Time getTime(int parameterIndex, Calendar cal)
142: throws SQLException {
143: return cstat.getTime(parameterIndex, cal);
144: }
145:
146: public Timestamp getTimestamp(int parameterIndex, Calendar cal)
147: throws SQLException {
148: return cstat.getTimestamp(parameterIndex, cal);
149: }
150:
151: public void registerOutParameter(int paramIndex, int sqlType,
152: String typeName) throws SQLException {
153: cstat.registerOutParameter(paramIndex, sqlType, typeName);
154: }
155:
156: public void registerOutParameter(String parameterName, int sqlType)
157: throws SQLException {
158: cstat.registerOutParameter(parameterName, sqlType);
159: }
160:
161: public void registerOutParameter(String parameterName, int sqlType,
162: int scale) throws SQLException {
163: cstat.registerOutParameter(parameterName, sqlType, scale);
164: }
165:
166: public void registerOutParameter(String parameterName, int sqlType,
167: String typeName) throws SQLException {
168: cstat.registerOutParameter(parameterName, sqlType, typeName);
169: }
170:
171: public java.net.URL getURL(int parameterIndex) throws SQLException {
172: return cstat.getURL(parameterIndex);
173: }
174:
175: public void setURL(String parameterName, java.net.URL val)
176: throws SQLException {
177: cstat.setURL(parameterName, val);
178: }
179:
180: public void setNull(String parameterName, int sqlType)
181: throws SQLException {
182: cstat.setNull(parameterName, sqlType);
183: }
184:
185: public void setBoolean(String parameterName, boolean x)
186: throws SQLException {
187: cstat.setBoolean(parameterName, x);
188: }
189:
190: public void setByte(String parameterName, byte x)
191: throws SQLException {
192: cstat.setByte(parameterName, x);
193: }
194:
195: public void setShort(String parameterName, short x)
196: throws SQLException {
197: cstat.setShort(parameterName, x);
198: }
199:
200: public void setInt(String parameterName, int x) throws SQLException {
201: cstat.setInt(parameterName, x);
202: }
203:
204: public void setLong(String parameterName, long x)
205: throws SQLException {
206: cstat.setLong(parameterName, x);
207: }
208:
209: public void setFloat(String parameterName, float x)
210: throws SQLException {
211: cstat.setFloat(parameterName, x);
212: }
213:
214: public void setDouble(String parameterName, double x)
215: throws SQLException {
216: cstat.setDouble(parameterName, x);
217: }
218:
219: public void setBigDecimal(String parameterName, BigDecimal x)
220: throws SQLException {
221: cstat.setBigDecimal(parameterName, x);
222: }
223:
224: public void setString(String parameterName, String x)
225: throws SQLException {
226: cstat.setString(parameterName, x);
227: }
228:
229: public void setBytes(String parameterName, byte x[])
230: throws SQLException {
231: cstat.setBytes(parameterName, x);
232: }
233:
234: public void setDate(String parameterName, Date x)
235: throws SQLException {
236: cstat.setDate(parameterName, x);
237: }
238:
239: public void setTime(String parameterName, Time x)
240: throws SQLException {
241: cstat.setTime(parameterName, x);
242: }
243:
244: public void setTimestamp(String parameterName, Timestamp x)
245: throws SQLException {
246: cstat.setTimestamp(parameterName, x);
247: }
248:
249: public void setAsciiStream(String parameterName,
250: java.io.InputStream x, int length) throws SQLException {
251: cstat.setAsciiStream(parameterName, x, length);
252: }
253:
254: public void setBinaryStream(String parameterName,
255: java.io.InputStream x, int length) throws SQLException {
256: cstat.setBinaryStream(parameterName, x, length);
257: }
258:
259: public void setObject(String parameterName, Object x,
260: int targetSqlType, int scale) throws SQLException {
261: cstat.setObject(parameterName, x, targetSqlType, scale);
262: }
263:
264: public void setObject(String parameterName, Object x,
265: int targetSqlType) throws SQLException {
266: cstat.setObject(parameterName, x, targetSqlType);
267: }
268:
269: public void setObject(String parameterName, Object x)
270: throws SQLException {
271: cstat.setObject(parameterName, x);
272: }
273:
274: public void setCharacterStream(String parameterName,
275: java.io.Reader reader, int length) throws SQLException {
276: cstat.setCharacterStream(parameterName, reader, length);
277: }
278:
279: public void setDate(String parameterName, Date x, Calendar cal)
280: throws SQLException {
281: cstat.setDate(parameterName, x, cal);
282: }
283:
284: public void setTime(String parameterName, Time x, Calendar cal)
285: throws SQLException {
286: cstat.setTime(parameterName, x, cal);
287: }
288:
289: public void setTimestamp(String parameterName, Timestamp x,
290: Calendar cal) throws SQLException {
291: cstat.setTimestamp(parameterName, x, cal);
292: }
293:
294: public void setNull(String parameterName, int sqlType,
295: String typeName) throws SQLException {
296: cstat.setNull(parameterName, sqlType, typeName);
297: }
298:
299: public String getString(String parameterName) throws SQLException {
300: return cstat.getString(parameterName);
301: }
302:
303: public boolean getBoolean(String parameterName) throws SQLException {
304: return cstat.getBoolean(parameterName);
305: }
306:
307: public byte getByte(String parameterName) throws SQLException {
308: return cstat.getByte(parameterName);
309: }
310:
311: public short getShort(String parameterName) throws SQLException {
312: return cstat.getShort(parameterName);
313: }
314:
315: public int getInt(String parameterName) throws SQLException {
316: return cstat.getInt(parameterName);
317: }
318:
319: public long getLong(String parameterName) throws SQLException {
320: return cstat.getLong(parameterName);
321: }
322:
323: public float getFloat(String parameterName) throws SQLException {
324: return cstat.getFloat(parameterName);
325: }
326:
327: public double getDouble(String parameterName) throws SQLException {
328: return cstat.getDouble(parameterName);
329: }
330:
331: public byte[] getBytes(String parameterName) throws SQLException {
332: return cstat.getBytes(parameterName);
333: }
334:
335: public Date getDate(String parameterName) throws SQLException {
336: return cstat.getDate(parameterName);
337: }
338:
339: public Time getTime(String parameterName) throws SQLException {
340: return cstat.getTime(parameterName);
341: }
342:
343: public Timestamp getTimestamp(String parameterName)
344: throws SQLException {
345: return cstat.getTimestamp(parameterName);
346: }
347:
348: public Object getObject(String parameterName) throws SQLException {
349: return cstat.getObject(parameterName);
350: }
351:
352: public BigDecimal getBigDecimal(String parameterName)
353: throws SQLException {
354: return cstat.getBigDecimal(parameterName);
355: }
356:
357: public Object getObject(String parameterName, Map map)
358: throws SQLException {
359: return cstat.getObject(parameterName, map);
360: }
361:
362: public Ref getRef(String parameterName) throws SQLException {
363: return cstat.getRef(parameterName);
364: }
365:
366: public Blob getBlob(String parameterName) throws SQLException {
367: return cstat.getBlob(parameterName);
368: }
369:
370: public Clob getClob(String parameterName) throws SQLException {
371: return cstat.getClob(parameterName);
372: }
373:
374: public Array getArray(String parameterName) throws SQLException {
375: return cstat.getArray(parameterName);
376: }
377:
378: public Date getDate(String parameterName, Calendar cal)
379: throws SQLException {
380: return cstat.getDate(parameterName, cal);
381: }
382:
383: public Time getTime(String parameterName, Calendar cal)
384: throws SQLException {
385: return cstat.getTime(parameterName, cal);
386: }
387:
388: public Timestamp getTimestamp(String parameterName, Calendar cal)
389: throws SQLException {
390: return cstat.getTimestamp(parameterName, cal);
391: }
392:
393: public java.net.URL getURL(String parameterName)
394: throws SQLException {
395: return cstat.getURL(parameterName);
396: }
397:
398: public ResultSet executeQuery() throws SQLException {
399: return cstat.executeQuery();
400: }
401:
402: public int executeUpdate() throws SQLException {
403: return cstat.executeUpdate();
404: }
405:
406: public void setNull(int parameterIndex, int sqlType)
407: throws SQLException {
408: cstat.setNull(parameterIndex, sqlType);
409: }
410:
411: public void setBoolean(int parameterIndex, boolean x)
412: throws SQLException {
413: cstat.setBoolean(parameterIndex, x);
414: }
415:
416: public void setByte(int parameterIndex, byte x) throws SQLException {
417: cstat.setByte(parameterIndex, x);
418: }
419:
420: public void setShort(int parameterIndex, short x)
421: throws SQLException {
422: cstat.setShort(parameterIndex, x);
423: }
424:
425: public void setInt(int parameterIndex, int x) throws SQLException {
426: cstat.setInt(parameterIndex, x);
427: }
428:
429: public void setLong(int parameterIndex, long x) throws SQLException {
430: cstat.setLong(parameterIndex, x);
431: }
432:
433: public void setFloat(int parameterIndex, float x)
434: throws SQLException {
435: cstat.setFloat(parameterIndex, x);
436: }
437:
438: public void setDouble(int parameterIndex, double x)
439: throws SQLException {
440: cstat.setDouble(parameterIndex, x);
441: }
442:
443: public void setBigDecimal(int parameterIndex, BigDecimal x)
444: throws SQLException {
445: cstat.setBigDecimal(parameterIndex, x);
446: }
447:
448: public void setString(int parameterIndex, String x)
449: throws SQLException {
450: cstat.setString(parameterIndex, x);
451: }
452:
453: public void setBytes(int parameterIndex, byte x[])
454: throws SQLException {
455: cstat.setBytes(parameterIndex, x);
456: }
457:
458: public void setDate(int parameterIndex, Date x) throws SQLException {
459: cstat.setDate(parameterIndex, x);
460: }
461:
462: public void setTime(int parameterIndex, Time x) throws SQLException {
463: cstat.setTime(parameterIndex, x);
464: }
465:
466: public void setTimestamp(int parameterIndex, Timestamp x)
467: throws SQLException {
468: cstat.setTimestamp(parameterIndex, x);
469: }
470:
471: public void setAsciiStream(int parameterIndex,
472: java.io.InputStream x, int length) throws SQLException {
473: cstat.setAsciiStream(parameterIndex, x, length);
474: }
475:
476: public void setUnicodeStream(int parameterIndex,
477: java.io.InputStream x, int length) throws SQLException {
478: cstat.setUnicodeStream(parameterIndex, x, length);
479: }
480:
481: public void setBinaryStream(int parameterIndex,
482: java.io.InputStream x, int length) throws SQLException {
483: cstat.setBinaryStream(parameterIndex, x, length);
484: }
485:
486: public void clearParameters() throws SQLException {
487: cstat.clearParameters();
488: }
489:
490: public void setObject(int parameterIndex, Object x,
491: int targetSqlType, int scale) throws SQLException {
492: cstat.setObject(parameterIndex, x, targetSqlType, scale);
493: }
494:
495: public void setObject(int parameterIndex, Object x,
496: int targetSqlType) throws SQLException {
497: cstat.setObject(parameterIndex, x, targetSqlType);
498: }
499:
500: public void setObject(int parameterIndex, Object x)
501: throws SQLException {
502: cstat.setObject(parameterIndex, x);
503: }
504:
505: public boolean execute() throws SQLException {
506: return cstat.execute();
507: }
508:
509: public void addBatch() throws SQLException {
510: cstat.addBatch();
511: }
512:
513: public void setCharacterStream(int parameterIndex,
514: java.io.Reader reader, int length) throws SQLException {
515: cstat.setCharacterStream(parameterIndex, reader, length);
516: }
517:
518: public void setRef(int i, Ref x) throws SQLException {
519: cstat.setRef(i, x);
520: }
521:
522: public void setBlob(int i, Blob x) throws SQLException {
523: cstat.setBlob(i, x);
524: }
525:
526: public void setClob(int i, Clob x) throws SQLException {
527: cstat.setClob(i, x);
528: }
529:
530: public void setArray(int i, Array x) throws SQLException {
531: cstat.setArray(i, x);
532: }
533:
534: public ResultSetMetaData getMetaData() throws SQLException {
535: return cstat.getMetaData();
536: }
537:
538: public void setDate(int parameterIndex, Date x, Calendar cal)
539: throws SQLException {
540: cstat.setDate(parameterIndex, x, cal);
541: }
542:
543: public void setTime(int parameterIndex, Time x, Calendar cal)
544: throws SQLException {
545: cstat.setTime(parameterIndex, x, cal);
546: }
547:
548: public void setTimestamp(int parameterIndex, Timestamp x,
549: Calendar cal) throws SQLException {
550: cstat.setTimestamp(parameterIndex, x, cal);
551: }
552:
553: public void setNull(int paramIndex, int sqlType, String typeName)
554: throws SQLException {
555: cstat.setNull(paramIndex, sqlType, typeName);
556: }
557:
558: public void setURL(int parameterIndex, java.net.URL x)
559: throws SQLException {
560: cstat.setURL(parameterIndex, x);
561: }
562:
563: public ParameterMetaData getParameterMetaData() throws SQLException {
564: return cstat.getParameterMetaData();
565: }
566:
567: public ResultSet executeQuery(String sql) throws SQLException {
568: return cstat.executeQuery(sql);
569: }
570:
571: public int executeUpdate(String sql) throws SQLException {
572: return cstat.executeUpdate(sql);
573: }
574:
575: public void close() throws SQLException {
576: cstat.close();
577: }
578:
579: public int getMaxFieldSize() throws SQLException {
580: return cstat.getMaxFieldSize();
581: }
582:
583: public void setMaxFieldSize(int max) throws SQLException {
584: cstat.setMaxFieldSize(max);
585: }
586:
587: public int getMaxRows() throws SQLException {
588: return cstat.getMaxRows();
589: }
590:
591: public void setMaxRows(int max) throws SQLException {
592: cstat.setMaxRows(max);
593: }
594:
595: public void setEscapeProcessing(boolean enable) throws SQLException {
596: cstat.setEscapeProcessing(enable);
597: }
598:
599: public int getQueryTimeout() throws SQLException {
600: return cstat.getQueryTimeout();
601: }
602:
603: public void setQueryTimeout(int seconds) throws SQLException {
604: cstat.setQueryTimeout(seconds);
605: }
606:
607: public void cancel() throws SQLException {
608: cstat.cancel();
609: }
610:
611: public SQLWarning getWarnings() throws SQLException {
612: return cstat.getWarnings();
613: }
614:
615: public void clearWarnings() throws SQLException {
616: cstat.clearWarnings();
617: }
618:
619: public void setCursorName(String name) throws SQLException {
620: cstat.setCursorName(name);
621: }
622:
623: public boolean execute(String sql) throws SQLException {
624: return cstat.execute(sql);
625: }
626:
627: public ResultSet getResultSet() throws SQLException {
628: return cstat.getResultSet();
629: }
630:
631: public int getUpdateCount() throws SQLException {
632: return cstat.getUpdateCount();
633: }
634:
635: public boolean getMoreResults() throws SQLException {
636: return cstat.getMoreResults();
637: }
638:
639: public void setFetchDirection(int direction) throws SQLException {
640: cstat.setFetchDirection(direction);
641: }
642:
643: public int getFetchDirection() throws SQLException {
644: return cstat.getFetchDirection();
645: }
646:
647: public void setFetchSize(int rows) throws SQLException {
648: cstat.setFetchSize(rows);
649: }
650:
651: public int getFetchSize() throws SQLException {
652: return cstat.getFetchSize();
653: }
654:
655: public int getResultSetConcurrency() throws SQLException {
656: return cstat.getResultSetConcurrency();
657: }
658:
659: public int getResultSetType() throws SQLException {
660: return cstat.getResultSetType();
661: }
662:
663: public void addBatch(String sql) throws SQLException {
664: cstat.addBatch(sql);
665: }
666:
667: public void clearBatch() throws SQLException {
668: cstat.clearBatch();
669: }
670:
671: public int[] executeBatch() throws SQLException {
672: return cstat.executeBatch();
673: }
674:
675: public Connection getConnection() throws SQLException {
676: return cstat.getConnection();
677: }
678:
679: public boolean getMoreResults(int current) throws SQLException {
680: return cstat.getMoreResults(current);
681: }
682:
683: public ResultSet getGeneratedKeys() throws SQLException {
684: return cstat.getGeneratedKeys();
685: }
686:
687: public int executeUpdate(String sql, int autoGeneratedKeys)
688: throws SQLException {
689: return cstat.executeUpdate(sql, autoGeneratedKeys);
690: }
691:
692: public int executeUpdate(String sql, int columnIndexes[])
693: throws SQLException {
694: return cstat.executeUpdate(sql, columnIndexes);
695: }
696:
697: public int executeUpdate(String sql, String columnNames[])
698: throws SQLException {
699: return cstat.executeUpdate(sql, columnNames);
700: }
701:
702: public boolean execute(String sql, int autoGeneratedKeys)
703: throws SQLException {
704: return cstat.execute(sql, autoGeneratedKeys);
705: }
706:
707: public boolean execute(String sql, int columnIndexes[])
708: throws SQLException {
709: return cstat.execute(sql, columnIndexes);
710: }
711:
712: public boolean execute(String sql, String columnNames[])
713: throws SQLException {
714: return cstat.execute(sql, columnNames);
715: }
716:
717: public int getResultSetHoldability() throws SQLException {
718: return cstat.getResultSetHoldability();
719: }
720:
721: }
|