Spring Boot — Show Hibernate SQL query | Code Factory

#show sql statement
logging.level.org.hibernate.SQL=debug
#show sql values
logging.level.org.hibernate.type.descriptor.sql=trace

1. org.hibernate.SQL=debug

#show sql statement
logging.level.org.hibernate.SQL=debug
2019-11-07 20:08:57.976 DEBUG 7248 --- [nio-8080-exec-1] org.hibernate.SQL                        : CALL FIND_EMP_BY_ID(?)

2. org.hibernate.type.descriptor.sql=trace

#show sql statement
logging.level.org.hibernate.SQL=debug
#show sql values
logging.level.org.hibernate.type.descriptor.sql=trace
2019-11-07 20:12:40.935 DEBUG 12248 --- [nio-8080-exec-1] org.hibernate.SQL                        : CALL FIND_EMP_BY_ID(?)
2019-11-07 20:12:40.947 TRACE 12248 --- [nio-8080-exec-1] o.h.type.descriptor.sql.BasicBinder : binding parameter [1] as [INTEGER] - [1]
2019-11-07 20:12:40.958 TRACE 12248 --- [nio-8080-exec-1] o.h.type.descriptor.sql.BasicExtractor : extracted value ([id] : [INTEGER]) - [1]
2019-11-07 20:12:40.969 TRACE 12248 --- [nio-8080-exec-1] o.h.type.descriptor.sql.BasicExtractor : extracted value ([name] : [VARCHAR]) - [emp1]
2019-11-07 20:12:40.971 TRACE 12248 --- [nio-8080-exec-1] o.h.type.descriptor.sql.BasicExtractor : extracted value ([salary] : [BIGINT]) - [1000]

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store