I use HSQLDB in my application. Now i need to log every single sql statement which was executed. I do not want to handle SQL-logging myself. Is there a standart way of doing this from within HSQLDB?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
HSQLDB 2.2.x supports SQL logging. Suppose your database is named
testand you connect using the JDBC URLjdbc:hsqldb:file:testtest.log is the data change log used internally by HSQLDB. It does not contain SELECT statements. It is created and deleted by HSQLDB. This is not what you are looking for.
test.sql.log is the log that contains all the SQL statements with time and session info, together with any arguments for prepared statements. This log is created if you use:
SET DATABASE EVENT LOG SQL LEVEL 3
It contains entries such as these:
You can use the hsqldb.sqllog=3 on the URL, e.g. jdbc:hsqldb:file:test;hsqldb.sqllog=3
See the Guide here and check the command and property syntax at the end of the chapter:
http://hsqldb.org/doc/2.0/guide/management-chapt.html#mtc_monitoring_operation