使用 IBM DB2 跟踪和 Eclipse Modeling Framework 检测资源泄漏
2010-02-04 00:00:00 来源:WEB开发网启用应用程序并通过 DBC URL 传递正确的跟踪参数之后,应该开始创建跟踪文件了。需要为每个打开的 SQL 连接都创建一个单独的文件。
清单 1 显示了 DB2 跟踪文件的一个示例。注意,为了在本文中正确显示它,我们将较长的代码行分开了。
清单 1. 示例 DB2 跟踪文件
[ibm][db2][jcc] BEGIN TRACE_DRIVER_CONFIGURATION
[ibm][db2][jcc] Driver: IBM DB2 JDBC Universal Driver Architecture 2.3.63
[ibm][db2][jcc] Compatible JRE versions: { 1.3, 1.4 }
…
[ibm][db2][jcc][Time:1250166693938][Thread:main][Connection@67df5ee8]
getAutoCommit () returned true
[ibm][db2][jcc][Time:1250166693938][Thread:main][Connection@67df5ee8]
clearWarnings () called
[ibm][db2][jcc][Time:1250166693938][Thread:main][Connection@67df5ee8]
getMetaData () returned DatabaseMetaData@721cdee9
[ibm][db2][jcc][Time:1250166693938][Thread:main][Connection@67df5ee8]
setTransactionIsolation (2) called
[ibm][db2][jcc][Time:1250166698906][Thread:main][Connection@67df5ee8]
getAutoCommit () returned true
[ibm][db2][jcc][Time:1250166698906][Thread:main][Connection@67df5ee8]
clearWarnings () called
[ibm][db2][jcc][Time:1250166698906][Thread:main][Connection@67df5ee8]
getMetaData () returned DatabaseMetaData@721cdee9
[ibm][db2][jcc][Time:1250166698906][Thread:main][Connection@67df5ee8]
setTransactionIsolation (2) called
[ibm][db2][jcc][Time:1250166698906][Thread:main][Connection@67df5ee8]
prepareStatement (select OBJ_ID from SCHEMA_NAME.OBJECT_CLASS
where CLASSNAME=?) called
[ibm][db2][jcc][Time:1250166698906][Thread:main][Connection@67df5ee8]
prepareStatement () returned PreparedStatement@6d0f1ee0
[ibm][db2][jcc][Time:1250166698906][Thread:main][PreparedStatement@6d0f1ee0]
setObject (1, java.lang.String) called
更多精彩
赞助商链接