Log4jdbcIs a Java JDBC driver that can log SQL and/or jdbc cils (and optionally SQL timing
Information) for other JDBC drivers
The official homepage is code.google.com/p/log4jdbc/
A log tool that prints SQL statements based on slf4j.The latest version is 1.2 final.
It mainly describes usage:
1. Select the version, mainly jdbc3 and jdbc4. Now we use jdbc4 to add the jar package to classpath.
2. Select the log system. Of course, slf4j + logback is the first
3. Modify the jdbc url. For a small modification, refer to the official documentation.
Take MYSQL as an example:
Original Configuration:
# JDBC. driverclassname = com. MySQL. JDBC. Driver
# JDBC. url = JDBC: mysql: // localhost: 3306/DTU? Useunicode = true & characterencoding = UTF-8
Current Configuration:
JDBC. driverclassname =Net. SF. log4jdbc. driverspy
JDBC. url = JDBC:LOg4jdbc:MySQL: // localhost: 3306/DTU? Useunicode = true & characterencoding = UTF-8
The user name and password remain unchanged
JDBC. Username = xxx
JDBC. Password = xxx
4. Add the log configuration. It seems JDBC. sqltiming is the most useful, and SQL + execution time
Enjoy it
Update