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

码农怀仔 2014-05-17 11:32:26
<!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 (?, ?, ?)



...全文
284 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
S117 2014-05-17
  • 打赏
  • 举报
回复
<property name="show_sql">true</property>这个呀,当为true的时候,你对数据库增删改查的语句都会打印出来的!
Tyler_Cheung 2014-05-17
  • 打赏
  • 举报
回复
<property name="show_sql">true</property> hibernate 查询到show sql指今==true 就会调用log4j 然后println.... 就这样你就看到了...
jiabiaoli 2014-05-17
  • 打赏
  • 举报
回复
<property name="show_sql">true</property> 打印sql,不想打印的话,去掉.
XH左岸 2014-05-17
  • 打赏
  • 举报
回复
飘过 楼上对的~~ 你可以去了解一下hibernate的配置属性··· 不过常用的也就是上面配那三个···

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧