목차

[적용 예] Data Source

개요

Data Source Service 를 적용해서 데이터베이스에 접속한다.

설명

Configuration

resources\spring\context-datasource.xml

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
    <property name="driverClassName" value="net.sf.log4jdbc.DriverSpy"/>
    <property name="url" value="jdbc:log4jdbc:hsqldb:hsql://localhost/cvpldb"/>
    <property name="username" value="sa"/>
    <property name="password" value=""/>
    <property name="defaultAutoCommit" value="false"/>
    <property name="poolPreparedStatements" value="true"/>
</bean>