<context:include-filtertype="annotation"expression="org.springframework.stereotype.Repository"/>
</context:component-scan>
<beanid="dataSource"class="com.mchange.v2.c3p0.ComboPooledDataSource"destroy-method="close">
<propertyname="driverClass"value="com.mysql.jdbc.Driver"/>
<propertyname="jdbcUrl"value="jdbc:mysql:///db_aries"/>
<propertyname="user"value="aries"/>
<propertyname="password"value="1991"/>
<propertyname="minPoolSize"value="5"/>
<propertyname="maxPoolSize"value="15"/>
<propertyname="initialPoolSize"value="5"/>
<propertyname="checkoutTimeout"value="3000"/>
<propertyname="idleConnectionTestPeriod"value="180"/>
<propertyname="maxIdleTime"value="180"/>
<propertyname="propertyCycle"value="300"/>
<propertyname="numHelperThreads"value="10"/>
<propertyname="maxStatements"value="100"/>
<propertyname="maxStatementsPerConnection"value="10"/>
<propertyname="acquireIncrement"value="3"/>
<propertyname="acquireRetryAttempts"value="30"/>

<propertyname="breakAfterAcquireFailure"value="false"/>
</bean>
<!--spring与mybatis整合-->
<beanid="sqlSessionFactory"class="org.mybatis.spring.SqlSessionFactoryBean">
<propertyname="dataSource"ref="dataSource"/>
<propertyname="configLocation"value="xml/mybatisConfig.xml"/>
</bean>
</beans>
4.mybatisConfig.xml
<?xmlversion="1.0"encoding="UTF-8"?>
<!DOCTYPEconfigurationPUBLIC"-//mybatis.org//DTDConfig3.0//EN"
本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/jisuanjixue/article-55464-5.html
这个只有对的方向才是最好的不是吗