cometta
cometta

Reputation: 35679

hibernate show_sql value

this is example of how sql is showed when using show_sql=true

Hibernate:
    select
        propertyse0_.entity_name as entity1_3_0_,
        propertyse0_.entity_id as entity2_3_0_,
        propertyse0_.entity_key as entity3_3_0_,
        propertyse0_.key_type as key4_3_0_,
        propertyse0_.boolean_val as boolean5_3_0_,
        propertyse0_.double_val as double6_3_0_,
        propertyse0_.string_val as string7_3_0_,
        propertyse0_.long_val as long8_3_0_,
        propertyse0_.int_val as int9_3_0_,
        propertyse0_.date_val as date10_3_0_
    from
        OS_PROPERTYENTRY propertyse0_
    where
        propertyse0_.entity_name=?
        and propertyse0_.entity_id=?
        and propertyse0_.entity_key=?

possible to show value to gather with the sql rather than '?'

Upvotes: 4

Views: 6332

Answers (3)

EJB
EJB

Reputation: 2413

Set your logging leven to "TRACE". In your log4j.properties (assuming your using Log4J):

log4j.logger.org.hibernate=TRACE

Will result in lots of logging tough...

Upvotes: 2

skaffman
skaffman

Reputation: 403441

You need to set up your logging framework to log this level of details. See here for the various loggers that Hibernate uses, and how to use them.

The particular one that you want is:

  • org.hibernate.type - Log all JDBC parameters

Upvotes: 2

bertolami
bertolami

Reputation: 2936

not directly. you can use log4jdbc to log all the data that is sent over jdbc. It has a logger that inlines the prepared statement values.

Upvotes: 0

Related Questions