16

How do I see the actual value in query instead of questions marks? Now, I am seeing

Hibernate: inser into TABEL (ID, FORMAT, SIZE) values (?,?,?)

I want to see the real values being used instead of the question marks.

I set this in my hibernate config file and turned on the debug flag.

<property name="show_sql"> true </property>

Thank you in advance.

codereviewanskquestions
  • 13,460
  • 29
  • 98
  • 167

2 Answers2

13

Hibernate uses prepared statements so you can't see the full SQL. You can set the log level for org.hibernate.type to trace to see the values bound to the parameters.

Reference

(As mentioned in/see also this answer).

Hauke Ingmar Schmidt
  • 11,559
  • 1
  • 42
  • 50
-1

Use Log4j or Logback to enable and set javax.sql to DEBUG:

<logger name="java.sql" level="debug">
    <appender-ref ref="STDOUT" /> <!-- or your own appender -->
</logger>
Mr. Polywhirl
  • 42,981
  • 12
  • 84
  • 132
alfonso.kim
  • 2,844
  • 4
  • 32
  • 37
  • This is not a solution for Hibernate. Spring Actuator shows no loggers with the names `javax.sql` or `java.sql`. – Oliver Jan 13 '21 at 01:24