ssh框架里show_sql在哪里设置

来源:百度知道 编辑:UC知道 时间:2024/07/04 12:07:12
以前hibernate里面配置的show_SQL

如果你是由spirng管理hibernate的话就如楼上所说的那样。

在你的spring配置文件中有个
sessionFactory Bean 节点下配置属性
<property name="hibernateProperties">
<props>
<prop key="hibernate.show_sql">true</prop>
...
</props>
</property>

<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="show_SQL">true</prop>

</props>
</property>

</bean>