1. 程式人生 > >SSH整合後console顯示sql語句

SSH整合後console顯示sql語句

<beans>
 <bean id="palceHolderConfig"
  class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
  abstract="false" singleton="true" lazy-init="default"
  autowire="default" dependency-check="default">
  <property name="location">
   <value>classpath:init.properties</value>
  </property>
 </bean>
 <!--c3p0資料來源配置-->
 <bean id="dataSource"
  class="com.mchange.v2.c3p0.ComboPooledDataSource"  destroy-method="close" dependency-check="default">
  <property name="driverClass">
   <value>${dataSource.driver}</value>
  </property>
  <property name="jdbcUrl">
   <value>${dataSource.jdbcUrl}</value>
  </property>
  <property name="user">
   <value>${dataSource.user}</value>
  </property>
  <property name="password">
   <value>${dataSource.password}</value>
  </property>
  
  <property name="acquireIncrement">
   <value>${dataSource.acquireIncrement}</value>
  </property>
  <property name="minPoolSize">
   <value>${dataSource.minPoolSize}</value>
  </property>
  <property name="maxPoolSize">
   <value>${dataSource.maxPoolSize}</value>
  </property>
  <property name="maxIdleTime">
   <value>${dataSource.maxIdleTime}</value>
  </property>
  <property name="idleConnectionTestPeriod">
   <value>${dataSource.idleConnectionTestPeriod}</value>
  </property>
 
  
 </bean>
 <bean id="sessionFactory"
  class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
  <property name="dataSource">
   <ref bean="dataSource" />
  </property>
  <property name="hibernateProperties">
   <props>
    <prop key="hibernate.dialect">
     org.hibernate.dialect.MySQLDialect
    </prop>
    <!-- 顯示sql語句 -->
    <prop key="hibernate.show_sql">true</prop>

   </props>

  </property>