Spring Boot — Show Hibernate SQL query | Code Factory

Code Factory
1 min readApr 25, 2020

--

Reference Link : Link

Donate : Link

application.properties

#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

application.properties

#show sql statement
logging.level.org.hibernate.SQL=debug

Console :

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

application.properties

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

Console :

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]

--

--