Java Tutorial/Spring/BasicDataSource
Config BasicDataSource
File: context.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="matchDao"
class="JdbcMatchDao">
<property name="dataSource" ref="dataSource"/>
</bean>
<bean id="dataSource" class="org.apache.rumons.dbcp.BasicDataSource">
<property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
<property name="url" value="jdbc:hsqldb:hsql:/localhost/test"/>
<property name="username" value="sa"/>
<property name="password" value=""/>
<property name="initialSize" value="10"/>
<property name="testOnBorrow" value="true"/>
</bean>
</beans>