日期:2014-05-16  浏览次数:20458 次

spring配置ibatis的jdbc方式和proxool、c3p0连接池方式

spring配置ibatis的jdbc方式和proxool、c3p0连接池方式

Posted on 2009-07-01 16:51 landor 阅读(3221) 评论(1) ?编辑 ?收藏 所属分类: ibatis <!-- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"> <rdf:Description rdf:about="http://www.blogjava.net/landor2004/archive/2009/07/01/284978.html" dc:identifier="http://www.blogjava.net/landor2004/archive/2009/07/01/284978.html" dc:title="spring配置ibatis的jdbc方式和proxool、c3p0连接池方式" trackback:ping="http://www.blogjava.net/landor2004/services/trackbacks/284978.aspx" /> </rdf:RDF> -->
spring配置ibatis的jdbc方式和proxool连接池方式,以sqlserver2005为例,驱动为sqljdbc.jar
jdbc.properties中内容如下
<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> -->jdbc.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc
.url=jdbc\:sqlserver\://localhost\:1433;?DatabaseName\=IBATIS
jdbc
.username=sa
jdbc
.password=123456
1 直接用jdbc方式(这种方式适合开发阶段,发布的程序强烈要求用连接池),代码如下,这个都知道,没什么可说的
<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><?xml?version="1.0"?encoding="UTF-8"?>
<beans?xmlns="http://www.springframework.org/schema/beans"
????xmlns:xsi
="http://www.w3.org/2001/XMLSchema-instance"
????xmlns:aop
="http://www.springframework.org/schema/aop"
????xmlns:context
="http://www.springframework.org/schema/context"