Hibernate SQL Parameter Values using Log4j Example

1 min read
Date: 2017-11-28
This tutorial demonstrates how to use Log4j to display actual parameter values in Hibernate SQL logs, replacing question marks with real-time data. It guides you through creating a Java Maven project in Eclipse, setting up MySQL, configuring Log4j and Hibernate (using log4j.xml
and hibernate.cfg.xml
), and building a simple application to insert data into a database table. The org.hibernate.type
setting in log4j.xml
is key to viewing parameter values. The tutorial uses Eclipse Kepler SR2, JDK 8, and MySQL.
0
Subscribe to my newsletter
Read articles from Yatin B. directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
