Spring Boot – Show Hibernate SQL query | Code Factory


Donate : Link

Medium Blog : Link

Applications : 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]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s