KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > jdbclogger > oracle10g > JdbcLoggerOracleConnectionWrapper


1 package net.sourceforge.jdbclogger.oracle10g;
2 /*
3  * Licensed to the Apache Software Foundation (ASF) under one or more
4  * contributor license agreements. See the NOTICE file distributed with
5  * this work for additional information regarding copyright ownership.
6  * The ASF licenses this file to You under the Apache License, Version 2.0
7  * (the "License"); you may not use this file except in compliance with
8  * the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18 import net.sourceforge.jdbclogger.core.ConnectionWrapper;
19 import oracle.jdbc.OracleConnection;
20 import oracle.jdbc.OracleOCIFailover;
21 import oracle.jdbc.OracleSavepoint;
22 import oracle.jdbc.internal.OraclePreparedStatement;
23 import oracle.jdbc.internal.OracleStatement;
24 import oracle.jdbc.pool.OracleConnectionCacheCallback;
25 import org.apache.commons.logging.Log;
26 import org.apache.commons.logging.LogFactory;
27
28 import java.sql.*;
29 import java.util.List JavaDoc;
30 import java.util.Properties JavaDoc;
31
32 /**
33  * @author Martin Marinschek (latest modification by $Author: catalean $)
34  * @version $Revision: 85 $ $Date: 2007-07-08 00:01:17 +0300 (Sun, 08 Jul 2007) $
35  */

36 public class JdbcLoggerOracleConnectionWrapper extends ConnectionWrapper implements OracleConnection
37 {
38     private OracleConnection _oracleConnection;
39     private static Log log = LogFactory.getLog(JdbcLoggerOracleConnectionWrapper.class);
40
41     public JdbcLoggerOracleConnectionWrapper(OracleConnection connection, List JavaDoc formatters)
42     {
43         super(connection,formatters);
44
45         _oracleConnection = connection;
46     }
47
48     public void archive(int i, int i1, String JavaDoc s) throws SQLException
49     {
50         _oracleConnection.archive(i,i1,s);
51     }
52
53     public void openProxySession(int i, Properties JavaDoc properties) throws SQLException
54     {
55         _oracleConnection.openProxySession(i,properties);
56     }
57
58     public boolean getAutoClose() throws SQLException
59     {
60         return _oracleConnection.getAutoClose();
61     }
62
63     public int getDefaultExecuteBatch()
64     {
65         return _oracleConnection.getDefaultExecuteBatch();
66     }
67
68     public int getDefaultRowPrefetch()
69     {
70         return _oracleConnection.getDefaultRowPrefetch();
71     }
72
73     public Object JavaDoc getDescriptor(String JavaDoc s)
74     {
75         return _oracleConnection.getDescriptor(s);
76     }
77
78     public String JavaDoc[] getEndToEndMetrics() throws SQLException
79     {
80         return _oracleConnection.getEndToEndMetrics();
81     }
82
83     public short getEndToEndECIDSequenceNumber() throws SQLException
84     {
85         return _oracleConnection.getEndToEndECIDSequenceNumber();
86     }
87
88     public boolean getIncludeSynonyms()
89     {
90         return _oracleConnection.getIncludeSynonyms();
91     }
92
93     public boolean getRestrictGetTables()
94     {
95         return _oracleConnection.getRestrictGetTables();
96     }
97
98     public Object JavaDoc getJavaObject(String JavaDoc s) throws SQLException
99     {
100         return _oracleConnection.getJavaObject(s);
101     }
102
103     public boolean getRemarksReporting()
104     {
105         return _oracleConnection.getRemarksReporting();
106     }
107
108     public String JavaDoc getSQLType(Object JavaDoc o) throws SQLException
109     {
110         return _oracleConnection.getSQLType(o);
111     }
112
113     public int getStmtCacheSize()
114     {
115         return _oracleConnection.getStmtCacheSize();
116     }
117
118     public short getStructAttrCsId() throws SQLException
119     {
120         return _oracleConnection.getStructAttrCsId();
121     }
122
123     public String JavaDoc getUserName() throws SQLException
124     {
125         return _oracleConnection.getUserName();
126     }
127
128     public boolean getUsingXAFlag()
129     {
130         return _oracleConnection.getUsingXAFlag();
131     }
132
133     public boolean getXAErrorFlag()
134     {
135         return _oracleConnection.getXAErrorFlag();
136     }
137
138     public int pingDatabase(int i) throws SQLException
139     {
140         return _oracleConnection.pingDatabase(i);
141     }
142
143     public void putDescriptor(String JavaDoc s, Object JavaDoc o) throws SQLException
144     {
145         _oracleConnection.putDescriptor(s,o);
146     }
147
148     public void registerSQLType(String JavaDoc s, Class JavaDoc aClass) throws SQLException
149     {
150         _oracleConnection.registerSQLType(s, aClass);
151     }
152
153     public void registerSQLType(String JavaDoc s, String JavaDoc s1) throws SQLException
154     {
155         _oracleConnection.registerSQLType(s,s1);
156     }
157
158     public void setAutoClose(boolean b) throws SQLException
159     {
160         _oracleConnection.setAutoClose(b);
161     }
162
163     public void setDefaultExecuteBatch(int i) throws SQLException
164     {
165         _oracleConnection.setDefaultExecuteBatch(i);
166     }
167
168     public void setDefaultRowPrefetch(int i) throws SQLException
169     {
170         _oracleConnection.setDefaultRowPrefetch(i);
171     }
172
173     public void setEndToEndMetrics(String JavaDoc[] strings, short i) throws SQLException
174     {
175         _oracleConnection.setEndToEndMetrics(strings,i);
176     }
177
178     public void setIncludeSynonyms(boolean b)
179     {
180         _oracleConnection.setIncludeSynonyms(b);
181     }
182
183     public void setRemarksReporting(boolean b)
184     {
185         _oracleConnection.setRemarksReporting(b);
186     }
187
188     public void setRestrictGetTables(boolean b)
189     {
190         _oracleConnection.setRestrictGetTables(b);
191     }
192
193     public void setStmtCacheSize(int i) throws SQLException
194     {
195         _oracleConnection.setStmtCacheSize(i);
196     }
197
198     public void setStmtCacheSize(int i, boolean b) throws SQLException
199     {
200         _oracleConnection.setStmtCacheSize(i,b);
201     }
202
203     public void setStatementCacheSize(int i) throws SQLException
204     {
205         _oracleConnection.setStatementCacheSize(i);
206     }
207
208     public int getStatementCacheSize() throws SQLException
209     {
210         return _oracleConnection.getStatementCacheSize();
211     }
212
213     public void setImplicitCachingEnabled(boolean b) throws SQLException
214     {
215         _oracleConnection.setImplicitCachingEnabled(b);
216     }
217
218     public boolean getImplicitCachingEnabled() throws SQLException
219     {
220         return _oracleConnection.getImplicitCachingEnabled();
221     }
222
223     public void setExplicitCachingEnabled(boolean b) throws SQLException
224     {
225         _oracleConnection.setExplicitCachingEnabled(b);
226     }
227
228     public boolean getExplicitCachingEnabled() throws SQLException
229     {
230         return _oracleConnection.getExplicitCachingEnabled();
231     }
232
233     public void purgeImplicitCache() throws SQLException
234     {
235         _oracleConnection.purgeImplicitCache();
236     }
237
238     public void purgeExplicitCache() throws SQLException
239     {
240         _oracleConnection.purgeExplicitCache();
241     }
242
243     public PreparedStatement getStatementWithKey(String JavaDoc s) throws SQLException
244     {
245         if(log.isDebugEnabled())
246             log.debug("Prepared Statement : "+s);
247
248         return new JdbcLoggerOraclePreparedStatementWrapper(
249                 (OraclePreparedStatement) _oracleConnection.getStatementWithKey(s),s,_formatters);
250     }
251
252     public CallableStatement getCallWithKey(String JavaDoc s) throws SQLException
253     {
254         return _oracleConnection.getCallWithKey(s);
255     }
256
257     public void setUsingXAFlag(boolean b)
258     {
259         _oracleConnection.setUsingXAFlag(b);
260     }
261
262     public void setXAErrorFlag(boolean b)
263     {
264         _oracleConnection.setXAErrorFlag(b);
265     }
266
267     public void shutdown(int i) throws SQLException
268     {
269         _oracleConnection.shutdown(i);
270     }
271
272     public void startup(String JavaDoc s, int i) throws SQLException
273     {
274         _oracleConnection.startup(s,i);
275     }
276
277     public PreparedStatement prepareStatementWithKey(String JavaDoc s) throws SQLException
278     {
279         if(log.isDebugEnabled())
280             log.debug("Prepared Statement : "+s);
281
282         return new JdbcLoggerOraclePreparedStatementWrapper(
283                 (OraclePreparedStatement) _oracleConnection.prepareStatementWithKey(s),s,_formatters);
284     }
285
286     public CallableStatement prepareCallWithKey(String JavaDoc s) throws SQLException
287     {
288         return _oracleConnection.prepareCallWithKey(s);
289     }
290
291     public void setCreateStatementAsRefCursor(boolean b)
292     {
293         _oracleConnection.setCreateStatementAsRefCursor(b);
294     }
295
296     public boolean getCreateStatementAsRefCursor()
297     {
298         return _oracleConnection.getCreateStatementAsRefCursor();
299     }
300
301     public void setSessionTimeZone(String JavaDoc s) throws SQLException
302     {
303         _oracleConnection.setSessionTimeZone(s);
304     }
305
306     public String JavaDoc getSessionTimeZone()
307     {
308         return _oracleConnection.getSessionTimeZone();
309     }
310
311     public Properties JavaDoc getProperties()
312     {
313         return _oracleConnection.getProperties();
314     }
315
316     public Connection _getPC()
317     {
318         return _oracleConnection._getPC();
319     }
320
321     public boolean isLogicalConnection()
322     {
323         return _oracleConnection.isLogicalConnection();
324     }
325
326     public void registerTAFCallback(OracleOCIFailover oracleOCIFailover, Object JavaDoc o) throws SQLException
327     {
328         _oracleConnection.registerTAFCallback(oracleOCIFailover, o);
329     }
330
331     public OracleConnection unwrap()
332     {
333         return _oracleConnection.unwrap();
334     }
335
336     public void setWrapper(OracleConnection oracleConnection)
337     {
338         _oracleConnection.setWrapper(oracleConnection);
339     }
340
341     public oracle.jdbc.internal.OracleConnection physicalConnectionWithin()
342     {
343         return _oracleConnection.physicalConnectionWithin();
344     }
345
346     public OracleSavepoint oracleSetSavepoint() throws SQLException
347     {
348         return _oracleConnection.oracleSetSavepoint();
349     }
350
351     public OracleSavepoint oracleSetSavepoint(String JavaDoc s) throws SQLException
352     {
353         return _oracleConnection.oracleSetSavepoint(s);
354     }
355
356     public void oracleRollback(OracleSavepoint oracleSavepoint) throws SQLException
357     {
358         _oracleConnection.oracleRollback(oracleSavepoint);
359     }
360
361     public void oracleReleaseSavepoint(OracleSavepoint oracleSavepoint) throws SQLException
362     {
363         _oracleConnection.oracleReleaseSavepoint(oracleSavepoint);
364     }
365
366     public void close(Properties JavaDoc properties) throws SQLException
367     {
368         _oracleConnection.close(properties);
369     }
370
371     public void close(int i) throws SQLException
372     {
373         _oracleConnection.close(i);
374     }
375
376     public boolean isProxySession()
377     {
378         return _oracleConnection.isProxySession();
379     }
380
381     public void applyConnectionAttributes(Properties JavaDoc properties) throws SQLException
382     {
383         _oracleConnection.applyConnectionAttributes(properties);
384     }
385
386     public Properties JavaDoc getConnectionAttributes() throws SQLException
387     {
388         return _oracleConnection.getConnectionAttributes();
389     }
390
391     public Properties JavaDoc getUnMatchedConnectionAttributes() throws SQLException
392     {
393         return _oracleConnection.getUnMatchedConnectionAttributes();
394     }
395
396     public void registerConnectionCacheCallback(OracleConnectionCacheCallback oracleConnectionCacheCallback, Object JavaDoc o, int i) throws SQLException
397     {
398         _oracleConnection.registerConnectionCacheCallback(oracleConnectionCacheCallback,o,i);
399     }
400
401     public void setConnectionReleasePriority(int i) throws SQLException
402     {
403         _oracleConnection.setConnectionReleasePriority(i);
404     }
405
406     public int getConnectionReleasePriority() throws SQLException
407     {
408         return _oracleConnection.getConnectionReleasePriority();
409     }
410
411     public void setPlsqlWarnings(String JavaDoc s) throws SQLException
412     {
413         _oracleConnection.setPlsqlWarnings(s);
414     }
415
416     public Statement createStatement() throws SQLException
417     {
418         return new JdbcLoggerOracleStatementWrapper((OracleStatement) _oracleConnection.createStatement());
419     }
420
421     public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException
422     {
423         return new JdbcLoggerOracleStatementWrapper((OracleStatement) _oracleConnection.createStatement(resultSetType, resultSetConcurrency));
424     }
425
426     public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
427     {
428         return new JdbcLoggerOracleStatementWrapper((OracleStatement) _oracleConnection.createStatement(resultSetType, resultSetConcurrency, resultSetHoldability));
429     }
430
431     public PreparedStatement prepareStatement(String JavaDoc sql) throws SQLException
432     {
433         return new JdbcLoggerOraclePreparedStatementWrapper(
434                 (OraclePreparedStatement) _oracleConnection.prepareStatement(sql), sql,_formatters);
435     }
436
437     public PreparedStatement prepareStatement(String JavaDoc sql, int autoGeneratedKeys) throws SQLException
438     {
439         return new JdbcLoggerOraclePreparedStatementWrapper(
440             (OraclePreparedStatement) _oracleConnection.prepareStatement(sql, autoGeneratedKeys),sql,_formatters);
441     }
442
443     public PreparedStatement prepareStatement(String JavaDoc sql, int resultSetType, int resultSetConcurrency) throws SQLException
444     {
445         return new JdbcLoggerOraclePreparedStatementWrapper(
446                 (OraclePreparedStatement)
447                 _oracleConnection.prepareStatement(sql, resultSetType, resultSetConcurrency),sql,_formatters);
448     }
449
450     public PreparedStatement prepareStatement(String JavaDoc sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
451     {
452         return new JdbcLoggerOraclePreparedStatementWrapper(
453                 (OraclePreparedStatement) _oracleConnection.prepareStatement(sql, resultSetType, resultSetConcurrency),sql,_formatters);
454     }
455
456     public PreparedStatement prepareStatement(String JavaDoc sql, int columnIndexes[]) throws SQLException
457     {
458         return new JdbcLoggerOraclePreparedStatementWrapper(
459                 (OraclePreparedStatement) _oracleConnection.prepareStatement(sql, columnIndexes),sql,_formatters);
460     }
461
462     public PreparedStatement prepareStatement(String JavaDoc sql, String JavaDoc columnNames[]) throws SQLException
463     {
464         return new JdbcLoggerOraclePreparedStatementWrapper(
465                 (OraclePreparedStatement) _oracleConnection.prepareStatement(sql, columnNames),sql,_formatters);
466     }
467 }
468
469
470
Popular Tags