java - How to trace sql commands for a specific connection to db2? -


I'm in the process of installing a central build server, the server is responsible for producing official building artifacts which Will be deployed for. One of the applications is a build step for one that writes to a database. At the deployed time we will need to run this build phase for proper construction. Since it is difficult / expensive, after rebuilding this build phase, the idea was to capture SQL scripts only for SQL running.

I have no control over source code which generates SQL This is a Java program that uses hibernate. I have not yet figured out where log4j.properties/log4j.xml can be used to access the hibernate trace functionality. And can there be a problem with 'prepared statement'? Instead of the actual value.

Does anyone have activity monitoring of DB2 and how to use it? Or are there other (simpler) options like changing the DB2 driver into the hibernate configuration? I still want to use the DB2 dynamite driver, though.

Edit: I do not have control over the database structure. Database structure may be updated or can be written in various tables in the future in the future. It should not affect the kind of solution it is now establishing.

Take a look at p6spy:

Support P6Spy applications Is an open source framework that modifies and alternatively modifies database details P6Spy distribution includes the following modules:

P6 log P6Log database statements of any application that uses JDBC Block and logs This application is especially useful for developers, who are EJ Minister is able to monitor the SQL statement created by servers, developers write code that achieve maximum efficiency on the server. The P6Spy is designed to be installed in minutes and does not require any code changes.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -