목차

Data Access

개요

Data Access 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>

resources\spring\context-salMap.xml

<!-- SqlMap setup for iBATIS Database Layer -->
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
	<property name="configLocation" value="classpath:/sqlmap/egov-sql-map-config.xml"/>
	<property name="dataSource" ref="dataSource"/>
</bean>

resources\sqlmap\egov-sql-map-config.xml

<sqlMapConfig>
    <!-- Hsql DB -->
    <sqlMap resource="sqlmap/rte/egov-cvpl-cmmn.mapping_Hsql.xml"/>
    <sqlMap resource="sqlmap/rte/egov-cvpl-cnslt.mapping_Hsql.xml"/>
    <sqlMap resource="sqlmap/rte/egov-cvpl-user.mapping_Hsql.xml"/> 
    <sqlMap resource="sqlmap/rte/egov-cvpl-faq.mapping_Hsql.xml"/>
</sqlMapConfig>