kofa wrote:
we're new to DB2 (using Express-C on Windows). We'd like to monitor the
SQL that Hibernate (a Java ORM) generates, along with query params.
To answer my own question: the JDBC driver can be set to trace
commands.
http://www-128.ibm.com/developerwork...m-0506fechner/
<blush>Sorry for the noise</blush>
Kofa
Still not good enough.
Here's an excerpt from the log:
[ibm][db2][jcc][Time:1155024677 451][Thread:main][Connection@c9d9 2c]
prepareStatemen t (select productimp_.id, productimp_.act ive as
active6_, productimp_.cod e as code6_, productimp_.des cription as
descript4_6_, productimp_.sto ck as stock6_, productimp_.adH ocPrice as
adHocPrice6_, productimp_.cos tPrice as costPrice6_,
productimp_.cat egory as category6_, productimp_.sup plier as supplier6_,
productimp_.typ e as type6_ from Product productimp_ where
productimp_.id= ?) called
[ibm][db2][jcc][Time:1155024677 451][Thread:main][Connection@c9d9 2c]
prepareStatemen t () returned PreparedStateme nt@106dc2d
[ibm][db2][jcc][Time:1155024677 451][Thread:main][PreparedStateme nt@106dc2d]
setLong (1, 522) called
[ibm][db2][jcc][Time:1155024677 451][Thread:main][PreparedStateme nt@106dc2d]
executeQuery () called
Not very easy to read (params shown on a separate line, in an even more
verbose fashion than we could get directly from Hibernate). The same
thing with MySQL:
Query select productimp_.id, productimp_.act ive as active6_,
productimp_.cod e as code6_, productimp_.des cription as descript4_6_,
productimp_.sto ck as stock6_, productimp_.adH ocPrice as adHocPrice6_,
productimp_.cos tPrice as costPrice6_, productimp_.cat egory as
category6_, productimp_.sup plier as supplier6_, productimp_.typ e as
type6_ from Product productimp_ where productimp_.id= 522
Any ideas (without costly third-party tools)?
TIA,
Kofa