You can use
logging:
level:
org:
hibernate:
type: trace #For prepared statements
in order to see the values of the data injected (the binding parameters) into the prepared statement.
Instead of just seeing question marks ('?'):
Hibernate:
insert
into
persons
(age, name, id)
values
(?, ?, ?)
you can see the actual data injected in the binding parameters:
2022-12-07 09:30:41.889 TRACE 8004 [main] o.h.type.descriptor.sql.BasicBinder : binding parameter [1] as [INTEGER] - [10]
2022-12-07 09:30:41.890 TRACE 8004 [main] o.h.type.descriptor.sql.BasicBinder : binding parameter [2] as [VARCHAR] - [Tom]
2022-12-07 09:30:41.891 TRACE 8004 [main] o.h.type.descriptor.sql.BasicBinder : binding parameter [3] as [BIGINT] - [12]
This way you can see that:
the first "?" will get the value of 10
the second "?" will get the value of 'Tom'
the third "?" will get the value of 12
From https://stackoverflow.com/a/63167967/2623162 and https://howtodoinjava.com/spring-boot/spring-data-jpa-sql-logging/
ANOTHER OPTION
from https://www.baeldung.com/hibernate-logging-levels is to have these in the logback.xml file (or log4j2 if you use log4j2):
<logger name="org.springframework.data.repository.CrudRepository" level="TRACE"/>
<logger name="org.hibernate.type.descriptor.sql" level="TRACE" />