【问题标题】:Show DBMS version in hibernate log在休眠日志中显示 DBMS 版本
【发布时间】:2015-02-10 09:05:32
【问题描述】:

我在question 中提出的问题。变得阻塞, 我尝试将ojdbc14的版本更改为ojdbc6。

我想在日志中显示DBMS的版本, 我应该将哪些属性添加到JpaProperties 显示DBMS 的版本

【问题讨论】:

    标签: hibernate oracle11g tomcat7 ojdbc hibernate-entitymanager


    【解决方案1】:

    Hibernate 应该打印出它在日志文件中使用的方言。我将根记录器设置为 INFO,以便打印出以下内容。

    我想如果你设置log4j.logger.org.hibernate=INFO 它应该可以工作。

    在您的服务器日志中查看以下行:

    HHH000412: Hibernate Core {4.2.8.Final} 04:33:28:0.472 
    HHH000206: hibernate.properties not found 04:33:28:0.475 
    HHH000021: Bytecode provider name : javassist 04:33:28:0.477 
    
    //The line below will tell you what dialect Hibernate is using to connect 
    //to your database. From there you should be able to work out what kind of 
    //database it is
    HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect 04:33:29:0.320 
    
    HHH000399: Using default transaction strategy (direct JDBC transactions) 04:33:29:0.547 
    HHH000397: Using ASTQueryTranslatorFactory 04:33:29:0.557 
    HV000001: Hibernate Validator 4.3.1.Final 04:33:29:0.632 
    HHH000229: Running schema validator 04:33:30:0.171 
    HHH000102: Fetching database metadata 04:33:30:0.171 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-11-06
      • 2017-08-24
      • 1970-01-01
      • 1970-01-01
      • 2011-10-05
      • 2013-10-14
      • 2011-08-19
      相关资源
      最近更新 更多