锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
聽聽聽聽涓嬮潰灝變互spring,hibernate鐜涓轟緥鏉ヨ鏄庡湪浣跨敤鏁版嵁搴撹繛鎺ユ睜鎯呭喌涓嬮厤緗畃6spy鍜宻ql profiler:
聽聽聽聽1.涓嬭澆p6spy鍜宻qlprofiler
聽聽聽聽聽聽聽聽聽http://www.p6spy.com
聽聽聽聽聽聽聽聽聽http://www.jahia.org
聽聽聽2.鎶婅В鍘嬪悗寰楀埌鐨刾6spy.jar鍔犲叆欏圭洰鏂囦歡鐨凜LASSPATH.
聽聽聽
聽聽聽聽3.鎶婅В鍘媠ql profiler鍚庡緱鍒扮殑spy.properties鏀懼叆榪愯鐜鐨勬牴鐩綍(Eclipse涓?灝嗗叾緗簬src鐩綍鑺傜偣涔嬩笅),淇敼spy.properties濡備笅:
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽# the mysql open source driver
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽realdriver=net.sourceforge.jtds.jdbc.Driver聽聽聽聽聽聽聽 //榪欓噷濉啓浣犵敤鐨勫疄闄呮暟鎹簱椹卞姩
聽聽聽
聽聽聽聽聽4.閰嶇疆spring鏂囦歡
聽聽聽聽聽聽聽聽聽<bean id="dataSource"
聽聽聽聽聽聽聽聽聽聽聽聽聽聽class="org.apache.commons.dbcp.BasicDataSource"
聽聽聽聽聽聽聽聽聽聽聽聽聽聽destroy-method="close">
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽<property name="driverClassName" value="${jdbc.driverClassName}" />
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽<property name="url" value="${jdbc.url}" />
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽<property name="username" value="${jdbc.username}" />
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽<property name="password" value="${jdbc.password}" />
聽聽聽聽聽聽聽聽聽</bean>
聽聽聽聽聽聽聽聽聽聽<bean id="myDataSource" class="com.p6spy.engine.spy.P6DataSource"
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 destroy-method="close">
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽<constructor-arg>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽<ref local="dataSource"/>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</constructor-arg>
聽聽聽聽聽聽聽聽聽聽聽</bean>
聽聽聽聽聽聽聽聽聽聽<!--Hibernate SessionFatory-->
聽聽聽聽聽聽聽聽聽聽<bean id="sessionFactory"
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽<property name="dataSource" ref="myDataSource" />
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽<property name="mappingDirectoryLocations">
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽<list>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽<value>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽classpath:/com/got/caip/domain/
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</value>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</list>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</property>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽<property name="hibernateProperties">
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽<props>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽<prop key="hibernate.dialect">
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽org.hibernate.dialect.SQLServerDialect
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</prop>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽<prop key="hibernate.show_sql">
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽${hibernate.show_sql}
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</prop>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽<prop key="hibernate.cache.use_query_cache">
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽${hibernate.cache.use_query_cache}
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</prop>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽<prop key="hibernate.cache.provider_class">
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽${hibernate.cache.provider_class}
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</prop>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽<prop key="hibernate.jdbc.batch_size">
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽20
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</prop>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽<prop key="net.sf.ehcache.configurationResourceName">
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽/ehcache.xml
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</prop>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</props>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</property>
聽聽聽聽聽聽聽聽聽聽聽聽聽</bean>
聽聽聽聽聽聽5.閫氳繃java -jar sqlprofiler鍚姩sql profiler