Skip to content
Advertisement

printing TypedQuery in console

How to sysout the TypedQuery in eclipse console. Am trying with .toString() and its not working

Please find my java code below.

JavaScript

Advertisement

Answer

You need to enable logging for the the following categories:

JavaScript

So a log4j configuration could look like:

JavaScript

The first is equivalent to hibernate.show_sql=true legacy property, the second prints the bound parameters among other things.

Another solution (non hibernate based) would be to use a JDBC proxy driver like P6Spy.

In case of spring boot is being used , just config this :

aplication.yml

JavaScript

aplication.properties

JavaScript

and nothing more.

Your log will be something like this:

JavaScript
Advertisement