ibatis原生不支持c3p0,要使用c3p0需要做一些扩展
1、把下面的文件下下来
2、把com包放入你的src下
3、把jar包放你的lib中
4、配置SqlMapConfig.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMapConfig PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-config-2.dtd"> <sqlMapConfig> <settings cacheModelsEnabled="true" lazyLoadingEnabled="true" maxRequests="32" maxSessions="10" maxTransactions="5" useStatementNamespaces="true"/> <transactionManager type="JDBC"> <dataSource type="C3P0"> <property name="driver" value="com.mysql.jdbc.Driver"/> <property name="url" value="jdbc:mysql://localhost/mydb?useUnicode=true&characterEncoding=UTF-8"/> <property name="username" value="root"/> <property name="password" value="123123"/> <property name="initialPoolSize" value="10"/> <property name="maxPoolSize" value="100"/> <property name="minPoolSize" value="10"/> <property name="acquireIncrement" value="5"/> <property name="maxIdleTime" value="3600"/> <property name="maxIdleTimeExcessConnections" value="1200"/> <property name="maxConnectionAge" value="27000"/> <property name="maxStatements" value="500"/> <property name="maxStatementsPerConnection" value="50"/> <property name="numHelperThreads" value="5"/> </dataSource>--> </transactionManager> </sqlMapConfig>
|
OK!大功告成
分享到:
相关推荐
NULL 博文链接:https://zuzong.iteye.com/blog/407835
添加了log4j 博文链接:https://xiao9.iteye.com/blog/952231
NULL 博文链接:https://jyao.iteye.com/blog/1759853
spring+ibatis集成开发文档,集成框架。
spring+ibatis集成.chm spring ibatis 集成 chm java 个人学习收集网上资料辛苦整理而成
struts1+spring+hibernate+ibatis集成
spring3.0加ibatis , 实例, 公司用的框架, 空项目 ,很稳定
spring与ibatis整合集成实例 spring与ibatis整合集成实例
struts1.2 spring2 ibatis 集成项目实战源码
Spring与iBATIS的集成,Spring与iBATIS的集成,Spring与iBATIS的集成
Spring+Ibatis集成开发实例.docSpring+Ibatis集成开发实例.doc
Spring与iBATIS的集成示例代码,希望对初学者有用
spring和ibatis集成开发的文档,非常值得相关的开发人员阅读!
简单的把hibernate与ibatis集成到一个项目中,供初学者参考
ibatis学习 ibatis总结 ibatis ibatis ibatis
spring.struts,ibatis集成包,还有很多常用的包,这是我项目中用到的包,在这里备份一个,还有一部分在framework_lib2中
Spring2.5.5 struts2.1.6 ibatis2.3.4 Mysql5.1 利用IntelliJ IDEA(9) 集成 所有JAR包已经包含
springmvc集成ibatis,