第一步:新建jdbc.properties
代码如下(仅供参考):
jdbc.initialSize=100
jdbc.maxActive=5
jdbc.maxWait=1000
jdbc.poolPreparedStatements=false
jdbc.maxOpenPreparedStatements=100
jdbc.defaultAutoCommit=false
hibernate.dialect=org.hibernate.dialect.SQLServerDialect
jdbc.driverClassName=net.sourceforge.jtds.jdbc.Driver
jdbc.url=这部分自己找哈,还是给个例子吧(jdbc:jtds:sqlserver://192.168.1.55:1433/testDB;charset=gbk;SelectMethod=CURSOR)
jdbc.username=sa
jdbc.password=pass
第二步:将jdbc.properties加载到spring中
在applicationContext.xml中加入以下代码
<!-- 加载jdbc.properties文件 -->
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:jdb