hibernate怎么显示sql语句
1个回答
展开全部
<hibernate-configuration>
<session-factory>
<property name="myeclipse.connection.profile">mysql</property>
<mapping resource="com/chenhui/bean/TUserLogin.hbm.xml" />
<mapping resource="com/chenhui/bean/TUserContent.hbm.xml" />
<mapping resource="com/chenhui/bean/TComment.hbm.xml" />
<mapping resource="com/chenhui/bean/TVideo.hbm.xml" />
<property name="dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="connection.url">
jdbc:mysql://localhost:3306/video
</property>
<property name="connection.username">root</property>
<property name="connection.password">123</property>
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="hibernate.show_sql">true</property><!-- 配置显示sql语句 -->
<property name="format_sql">true</property><!-- 让输出的sql语句格式化 -->
</session-factory>
</hibernate-configuration>
<session-factory>
<property name="myeclipse.connection.profile">mysql</property>
<mapping resource="com/chenhui/bean/TUserLogin.hbm.xml" />
<mapping resource="com/chenhui/bean/TUserContent.hbm.xml" />
<mapping resource="com/chenhui/bean/TComment.hbm.xml" />
<mapping resource="com/chenhui/bean/TVideo.hbm.xml" />
<property name="dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="connection.url">
jdbc:mysql://localhost:3306/video
</property>
<property name="connection.username">root</property>
<property name="connection.password">123</property>
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="hibernate.show_sql">true</property><!-- 配置显示sql语句 -->
<property name="format_sql">true</property><!-- 让输出的sql语句格式化 -->
</session-factory>
</hibernate-configuration>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询