001: package net.sourceforge.jdbclogger.oracle10g;
002:
003: /*
004: * Licensed to the Apache Software Foundation (ASF) under one or more
005: * contributor license agreements. See the NOTICE file distributed with
006: * this work for additional information regarding copyright ownership.
007: * The ASF licenses this file to You under the Apache License, Version 2.0
008: * (the "License"); you may not use this file except in compliance with
009: * the License. You may obtain a copy of the License at
010: *
011: * http://www.apache.org/licenses/LICENSE-2.0
012: *
013: * Unless required by applicable law or agreed to in writing, software
014: * distributed under the License is distributed on an "AS IS" BASIS,
015: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016: * See the License for the specific language governing permissions and
017: * limitations under the License.
018: */
019: import net.sourceforge.jdbclogger.core.ConnectionWrapper;
020: import oracle.jdbc.OracleConnection;
021: import oracle.jdbc.OracleOCIFailover;
022: import oracle.jdbc.OracleSavepoint;
023: import oracle.jdbc.internal.OraclePreparedStatement;
024: import oracle.jdbc.internal.OracleStatement;
025: import oracle.jdbc.pool.OracleConnectionCacheCallback;
026: import org.apache.commons.logging.Log;
027: import org.apache.commons.logging.LogFactory;
028:
029: import java.sql.*;
030: import java.util.List;
031: import java.util.Properties;
032:
033: /**
034: * @author Martin Marinschek (latest modification by $Author: catalean $)
035: * @version $Revision: 85 $ $Date: 2007-07-07 14:01:17 -0700 (Sat, 07 Jul 2007) $
036: */
037: public class JdbcLoggerOracleConnectionWrapper extends
038: ConnectionWrapper implements OracleConnection {
039: private OracleConnection _oracleConnection;
040: private static Log log = LogFactory
041: .getLog(JdbcLoggerOracleConnectionWrapper.class);
042:
043: public JdbcLoggerOracleConnectionWrapper(
044: OracleConnection connection, List formatters) {
045: super (connection, formatters);
046:
047: _oracleConnection = connection;
048: }
049:
050: public void archive(int i, int i1, String s) throws SQLException {
051: _oracleConnection.archive(i, i1, s);
052: }
053:
054: public void openProxySession(int i, Properties properties)
055: throws SQLException {
056: _oracleConnection.openProxySession(i, properties);
057: }
058:
059: public boolean getAutoClose() throws SQLException {
060: return _oracleConnection.getAutoClose();
061: }
062:
063: public int getDefaultExecuteBatch() {
064: return _oracleConnection.getDefaultExecuteBatch();
065: }
066:
067: public int getDefaultRowPrefetch() {
068: return _oracleConnection.getDefaultRowPrefetch();
069: }
070:
071: public Object getDescriptor(String s) {
072: return _oracleConnection.getDescriptor(s);
073: }
074:
075: public String[] getEndToEndMetrics() throws SQLException {
076: return _oracleConnection.getEndToEndMetrics();
077: }
078:
079: public short getEndToEndECIDSequenceNumber() throws SQLException {
080: return _oracleConnection.getEndToEndECIDSequenceNumber();
081: }
082:
083: public boolean getIncludeSynonyms() {
084: return _oracleConnection.getIncludeSynonyms();
085: }
086:
087: public boolean getRestrictGetTables() {
088: return _oracleConnection.getRestrictGetTables();
089: }
090:
091: public Object getJavaObject(String s) throws SQLException {
092: return _oracleConnection.getJavaObject(s);
093: }
094:
095: public boolean getRemarksReporting() {
096: return _oracleConnection.getRemarksReporting();
097: }
098:
099: public String getSQLType(Object o) throws SQLException {
100: return _oracleConnection.getSQLType(o);
101: }
102:
103: public int getStmtCacheSize() {
104: return _oracleConnection.getStmtCacheSize();
105: }
106:
107: public short getStructAttrCsId() throws SQLException {
108: return _oracleConnection.getStructAttrCsId();
109: }
110:
111: public String getUserName() throws SQLException {
112: return _oracleConnection.getUserName();
113: }
114:
115: public boolean getUsingXAFlag() {
116: return _oracleConnection.getUsingXAFlag();
117: }
118:
119: public boolean getXAErrorFlag() {
120: return _oracleConnection.getXAErrorFlag();
121: }
122:
123: public int pingDatabase(int i) throws SQLException {
124: return _oracleConnection.pingDatabase(i);
125: }
126:
127: public void putDescriptor(String s, Object o) throws SQLException {
128: _oracleConnection.putDescriptor(s, o);
129: }
130:
131: public void registerSQLType(String s, Class aClass)
132: throws SQLException {
133: _oracleConnection.registerSQLType(s, aClass);
134: }
135:
136: public void registerSQLType(String s, String s1)
137: throws SQLException {
138: _oracleConnection.registerSQLType(s, s1);
139: }
140:
141: public void setAutoClose(boolean b) throws SQLException {
142: _oracleConnection.setAutoClose(b);
143: }
144:
145: public void setDefaultExecuteBatch(int i) throws SQLException {
146: _oracleConnection.setDefaultExecuteBatch(i);
147: }
148:
149: public void setDefaultRowPrefetch(int i) throws SQLException {
150: _oracleConnection.setDefaultRowPrefetch(i);
151: }
152:
153: public void setEndToEndMetrics(String[] strings, short i)
154: throws SQLException {
155: _oracleConnection.setEndToEndMetrics(strings, i);
156: }
157:
158: public void setIncludeSynonyms(boolean b) {
159: _oracleConnection.setIncludeSynonyms(b);
160: }
161:
162: public void setRemarksReporting(boolean b) {
163: _oracleConnection.setRemarksReporting(b);
164: }
165:
166: public void setRestrictGetTables(boolean b) {
167: _oracleConnection.setRestrictGetTables(b);
168: }
169:
170: public void setStmtCacheSize(int i) throws SQLException {
171: _oracleConnection.setStmtCacheSize(i);
172: }
173:
174: public void setStmtCacheSize(int i, boolean b) throws SQLException {
175: _oracleConnection.setStmtCacheSize(i, b);
176: }
177:
178: public void setStatementCacheSize(int i) throws SQLException {
179: _oracleConnection.setStatementCacheSize(i);
180: }
181:
182: public int getStatementCacheSize() throws SQLException {
183: return _oracleConnection.getStatementCacheSize();
184: }
185:
186: public void setImplicitCachingEnabled(boolean b)
187: throws SQLException {
188: _oracleConnection.setImplicitCachingEnabled(b);
189: }
190:
191: public boolean getImplicitCachingEnabled() throws SQLException {
192: return _oracleConnection.getImplicitCachingEnabled();
193: }
194:
195: public void setExplicitCachingEnabled(boolean b)
196: throws SQLException {
197: _oracleConnection.setExplicitCachingEnabled(b);
198: }
199:
200: public boolean getExplicitCachingEnabled() throws SQLException {
201: return _oracleConnection.getExplicitCachingEnabled();
202: }
203:
204: public void purgeImplicitCache() throws SQLException {
205: _oracleConnection.purgeImplicitCache();
206: }
207:
208: public void purgeExplicitCache() throws SQLException {
209: _oracleConnection.purgeExplicitCache();
210: }
211:
212: public PreparedStatement getStatementWithKey(String s)
213: throws SQLException {
214: if (log.isDebugEnabled())
215: log.debug("Prepared Statement : " + s);
216:
217: return new JdbcLoggerOraclePreparedStatementWrapper(
218: (OraclePreparedStatement) _oracleConnection
219: .getStatementWithKey(s), s, _formatters);
220: }
221:
222: public CallableStatement getCallWithKey(String s)
223: throws SQLException {
224: return _oracleConnection.getCallWithKey(s);
225: }
226:
227: public void setUsingXAFlag(boolean b) {
228: _oracleConnection.setUsingXAFlag(b);
229: }
230:
231: public void setXAErrorFlag(boolean b) {
232: _oracleConnection.setXAErrorFlag(b);
233: }
234:
235: public void shutdown(int i) throws SQLException {
236: _oracleConnection.shutdown(i);
237: }
238:
239: public void startup(String s, int i) throws SQLException {
240: _oracleConnection.startup(s, i);
241: }
242:
243: public PreparedStatement prepareStatementWithKey(String s)
244: throws SQLException {
245: if (log.isDebugEnabled())
246: log.debug("Prepared Statement : " + s);
247:
248: return new JdbcLoggerOraclePreparedStatementWrapper(
249: (OraclePreparedStatement) _oracleConnection
250: .prepareStatementWithKey(s), s, _formatters);
251: }
252:
253: public CallableStatement prepareCallWithKey(String s)
254: throws SQLException {
255: return _oracleConnection.prepareCallWithKey(s);
256: }
257:
258: public void setCreateStatementAsRefCursor(boolean b) {
259: _oracleConnection.setCreateStatementAsRefCursor(b);
260: }
261:
262: public boolean getCreateStatementAsRefCursor() {
263: return _oracleConnection.getCreateStatementAsRefCursor();
264: }
265:
266: public void setSessionTimeZone(String s) throws SQLException {
267: _oracleConnection.setSessionTimeZone(s);
268: }
269:
270: public String getSessionTimeZone() {
271: return _oracleConnection.getSessionTimeZone();
272: }
273:
274: public Properties getProperties() {
275: return _oracleConnection.getProperties();
276: }
277:
278: public Connection _getPC() {
279: return _oracleConnection._getPC();
280: }
281:
282: public boolean isLogicalConnection() {
283: return _oracleConnection.isLogicalConnection();
284: }
285:
286: public void registerTAFCallback(
287: OracleOCIFailover oracleOCIFailover, Object o)
288: throws SQLException {
289: _oracleConnection.registerTAFCallback(oracleOCIFailover, o);
290: }
291:
292: public OracleConnection unwrap() {
293: return _oracleConnection.unwrap();
294: }
295:
296: public void setWrapper(OracleConnection oracleConnection) {
297: _oracleConnection.setWrapper(oracleConnection);
298: }
299:
300: public oracle.jdbc.internal.OracleConnection physicalConnectionWithin() {
301: return _oracleConnection.physicalConnectionWithin();
302: }
303:
304: public OracleSavepoint oracleSetSavepoint() throws SQLException {
305: return _oracleConnection.oracleSetSavepoint();
306: }
307:
308: public OracleSavepoint oracleSetSavepoint(String s)
309: throws SQLException {
310: return _oracleConnection.oracleSetSavepoint(s);
311: }
312:
313: public void oracleRollback(OracleSavepoint oracleSavepoint)
314: throws SQLException {
315: _oracleConnection.oracleRollback(oracleSavepoint);
316: }
317:
318: public void oracleReleaseSavepoint(OracleSavepoint oracleSavepoint)
319: throws SQLException {
320: _oracleConnection.oracleReleaseSavepoint(oracleSavepoint);
321: }
322:
323: public void close(Properties properties) throws SQLException {
324: _oracleConnection.close(properties);
325: }
326:
327: public void close(int i) throws SQLException {
328: _oracleConnection.close(i);
329: }
330:
331: public boolean isProxySession() {
332: return _oracleConnection.isProxySession();
333: }
334:
335: public void applyConnectionAttributes(Properties properties)
336: throws SQLException {
337: _oracleConnection.applyConnectionAttributes(properties);
338: }
339:
340: public Properties getConnectionAttributes() throws SQLException {
341: return _oracleConnection.getConnectionAttributes();
342: }
343:
344: public Properties getUnMatchedConnectionAttributes()
345: throws SQLException {
346: return _oracleConnection.getUnMatchedConnectionAttributes();
347: }
348:
349: public void registerConnectionCacheCallback(
350: OracleConnectionCacheCallback oracleConnectionCacheCallback,
351: Object o, int i) throws SQLException {
352: _oracleConnection.registerConnectionCacheCallback(
353: oracleConnectionCacheCallback, o, i);
354: }
355:
356: public void setConnectionReleasePriority(int i) throws SQLException {
357: _oracleConnection.setConnectionReleasePriority(i);
358: }
359:
360: public int getConnectionReleasePriority() throws SQLException {
361: return _oracleConnection.getConnectionReleasePriority();
362: }
363:
364: public void setPlsqlWarnings(String s) throws SQLException {
365: _oracleConnection.setPlsqlWarnings(s);
366: }
367:
368: public Statement createStatement() throws SQLException {
369: return new JdbcLoggerOracleStatementWrapper(
370: (OracleStatement) _oracleConnection.createStatement());
371: }
372:
373: public Statement createStatement(int resultSetType,
374: int resultSetConcurrency) throws SQLException {
375: return new JdbcLoggerOracleStatementWrapper(
376: (OracleStatement) _oracleConnection.createStatement(
377: resultSetType, resultSetConcurrency));
378: }
379:
380: public Statement createStatement(int resultSetType,
381: int resultSetConcurrency, int resultSetHoldability)
382: throws SQLException {
383: return new JdbcLoggerOracleStatementWrapper(
384: (OracleStatement) _oracleConnection.createStatement(
385: resultSetType, resultSetConcurrency,
386: resultSetHoldability));
387: }
388:
389: public PreparedStatement prepareStatement(String sql)
390: throws SQLException {
391: return new JdbcLoggerOraclePreparedStatementWrapper(
392: (OraclePreparedStatement) _oracleConnection
393: .prepareStatement(sql), sql, _formatters);
394: }
395:
396: public PreparedStatement prepareStatement(String sql,
397: int autoGeneratedKeys) throws SQLException {
398: return new JdbcLoggerOraclePreparedStatementWrapper(
399: (OraclePreparedStatement) _oracleConnection
400: .prepareStatement(sql, autoGeneratedKeys), sql,
401: _formatters);
402: }
403:
404: public PreparedStatement prepareStatement(String sql,
405: int resultSetType, int resultSetConcurrency)
406: throws SQLException {
407: return new JdbcLoggerOraclePreparedStatementWrapper(
408: (OraclePreparedStatement) _oracleConnection
409: .prepareStatement(sql, resultSetType,
410: resultSetConcurrency), sql, _formatters);
411: }
412:
413: public PreparedStatement prepareStatement(String sql,
414: int resultSetType, int resultSetConcurrency,
415: int resultSetHoldability) throws SQLException {
416: return new JdbcLoggerOraclePreparedStatementWrapper(
417: (OraclePreparedStatement) _oracleConnection
418: .prepareStatement(sql, resultSetType,
419: resultSetConcurrency), sql, _formatters);
420: }
421:
422: public PreparedStatement prepareStatement(String sql,
423: int columnIndexes[]) throws SQLException {
424: return new JdbcLoggerOraclePreparedStatementWrapper(
425: (OraclePreparedStatement) _oracleConnection
426: .prepareStatement(sql, columnIndexes), sql,
427: _formatters);
428: }
429:
430: public PreparedStatement prepareStatement(String sql,
431: String columnNames[]) throws SQLException {
432: return new JdbcLoggerOraclePreparedStatementWrapper(
433: (OraclePreparedStatement) _oracleConnection
434: .prepareStatement(sql, columnNames), sql,
435: _formatters);
436: }
437: }
|