当前位置: 代码迷 >> Java Web开发 >> 大神们,小弟我想问下Hibernate: insert into Teacher (age, name, id) values (? ? ?)如何出来的,是哪句
  详细解决方案

大神们,小弟我想问下Hibernate: insert into Teacher (age, name, id) values (? ? ?)如何出来的,是哪句

热度:718   发布时间:2016-04-16 22:23:52.0
大神们,我想问下Hibernate: insert into Teacher (age, name, id) values (?, ?, ?)怎么出来的,是哪句
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
        <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
        <property name="hibernate.connection.url">jdbc:mysql://localhost/hibernate</property>
        <property name="hibernate.connection.username">root</property>
        <property name="hibernate.connection.password">123</property>
    <property name="show_sql">true</property>
<property name="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="hbm2ddl.auto">create</property>
<mapping resource="com/qin/co/Student.hbm.xml" />
    <mapping  class="com.qin.co.Teacher"/>

</session-factory>

</hibernate-configuration>


SLF4J: The requested version 1.5.8 by your slf4j binding is not compatible with [1.6]
SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details.

我想问这个语句是怎么出来的,是日志吗,大神们,帮回答下
Hibernate: insert into Teacher (age, name, id) values (?, ?, ?)
Hibernate: insert into Teacher (age, name, id) values (?, ?, ?)




------解决方案--------------------
 <property name="show_sql">true</property>

hibernate 查询到show sql指今==true 就会调用log4j 然后println....
就这样你就看到了...
  相关解决方案