sitelink1 | |
---|---|
sitelink2 | |
sitelink3 | |
extra_vars6 |
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Application context definition for JPetStore's data access layer.
- Accessed by business layer objects defined in "applicationContext.xml"
- (see web.xml's "contextConfigLocation").
-
- This version of the data access layer works on two databases (main/order),
- using JNDI DataSources with JtaTransactionManager. It obviously depends on
- JTA support in the container, and on pre-configured container DataSources.
-
- This version also uses the "jndi:" namespace introduced in Spring 2.0
- to configured JNDI referenced objects.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.0.xsd">
<!-- ========================= RESOURCE DEFINITIONS ========================= -->
<!-- Main JNDI DataSource for J2EE environments -->
<!-- Refers to the main database, containing product and account data -->
<!-- (see dataAccessContext-local.xml for an alternative) -->
<jee:jndi-lookup id="dataSource" jndi-name="java:comp/env/jdbc/jpetstore"/>
<!-- Additional JNDI DataSource for J2EE environments -->
<!-- Refers to the order database, containing order data -->
<!-- (see dataAccessContext-local.xml for an alternative) -->
<jee:jndi-lookup id="orderDataSource" jndi-name="java:comp/env/jdbc/jpetstore-order"/>
<!-- Transaction manager that delegates to JTA (for a transactional JNDI DataSource) -->
<!-- Necessary here due to the need for distributed transactions across two databases -->
<!-- (see dataAccessContext-local.xml for an alternative) -->
<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"/>
JTA가 두 데이터베이스의 분산 트랜잭션을 보장해준다는 거군.
<!-- SqlMap setup for iBATIS Database Layer -->
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" value="WEB-INF/sql-map-config.xml"/>
</bean>
web.xml 화일의 맨 밑의 하단부를 보면 <resource-ref>태그로 "jdbc/jpetstore"와 "jdbc/jpetstore-order"가 정의되어 있다.
<!-- ========================= DAO DEFINITIONS: IBATIS IMPLEMENTATIONS ========================= -->
<bean id="accountDao" class="org.springframework.samples.jpetstore.dao.ibatis.SqlMapAccountDao">
<property name="dataSource" ref="dataSource"/>
<property name="sqlMapClient" ref="sqlMapClient"/>
</bean>
<bean id="categoryDao" class="org.springframework.samples.jpetstore.dao.ibatis.SqlMapCategoryDao">
<property name="dataSource" ref="dataSource"/>
<property name="sqlMapClient" ref="sqlMapClient"/>
</bean>
<bean id="productDao" class="org.springframework.samples.jpetstore.dao.ibatis.SqlMapProductDao">
<property name="dataSource" ref="dataSource"/>
<property name="sqlMapClient" ref="sqlMapClient"/>
</bean>
<bean id="itemDao" class="org.springframework.samples.jpetstore.dao.ibatis.SqlMapItemDao">
<property name="dataSource" ref="dataSource"/>
<property name="sqlMapClient" ref="sqlMapClient"/>
</bean>
<!-- Refers to the order database here -->
<!-- (see dataAccessContext-local.xml for an alternative) -->
<bean id="orderDao" class="org.springframework.samples.jpetstore.dao.ibatis.SqlMapOrderDao">
<property name="dataSource" ref="orderDataSource"/>
<property name="sqlMapClient" ref="sqlMapClient"/>
<property name="sequenceDao" ref="sequenceDao"/>
</bean>
<!-- OrderDao definition for MS SQL Server -->
<!-- (to be used instead of the default orderDao) -->
<!--
<bean id="orderDao" class="org.springframework.samples.jpetstore.dao.ibatis.MsSqlOrderDao">
<property name="dataSource" ref="orderDataSource"/>
<property name="sqlMapClient" ref="sqlMapClient"/>
<property name="sequenceDao" ref="sequenceDao"/>
</bean>
-->
<!-- Refers to the order database here -->
<!-- (see dataAccessContext-local.xml for an alternative) -->
<bean id="sequenceDao" class="org.springframework.samples.jpetstore.dao.ibatis.SqlMapSequenceDao">
<property name="dataSource" ref="orderDataSource"/>
<property name="sqlMapClient" ref="sqlMapClient"/>
</bean>
<!-- SequenceDao definition for Oracle databases -->
<!-- (to be used instead of the default sequenceDao) -->
<!--
<bean id="sequenceDao" class="org.springframework.samples.jpetstore.dao.ibatis.OracleSequenceDao">
<property name="dataSource" ref="orderDataSource"/>
<property name="sqlMapClient" ref="sqlMapClient"/>
</bean>
-->
</beans>
댓글 0
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
공지 | (확인전) [2021.03.12] Eclipse에서 Spring Boot로 JSP사용하기(Gradle) | 황제낙엽 | 2023.12.23 | 581 |
공지 | [작성중/인프런] 스프링부트 시큐리티 & JWT 강의 | 황제낙엽 | 2023.12.20 | 573 |
10 |
Eclipse, Spring Boot, Gradle, SVN 레거시(2019) 시스템 유지보수 환경 구축
![]() | 황제낙엽 | 2023.11.14 | 104 |
9 |
실습 STEP2 - 기초편 (데이터 베이스 접속)
![]() | 황제낙엽 | 2007.06.21 | 128 |
8 |
실습 STEP1 - 기초편 (Hello Spring 출력)
![]() | 황제낙엽 | 2007.04.27 | 131 |
7 |
Cugain의 샘플프로젝트 jpetstore 분석기 - (1) jpetstore 설치
![]() | 황제낙엽 | 2007.02.22 | 214 |
6 | Cugain의 샘플프로젝트 jpetstore 분석기 - (7) PetStoreImpl.java | 황제낙엽 | 2007.05.24 | 134 |
5 | Cugain의 샘플프로젝트 jpetstore 분석기 - (6) petstore-servlet.xml 분석 | 황제낙엽 | 2007.04.27 | 105 |
4 | Cugain의 샘플프로젝트 jpetstore 분석기 - (5) applicationContext.xml 분석 | 황제낙엽 | 2007.04.21 | 317 |
» | Cugain의 샘플프로젝트 jpetstore 분석기 - (4) dataAccessContext-jta.xml 분석 | 황제낙엽 | 2007.04.21 | 116 |
2 | Cugain의 샘플프로젝트 jpetstore 분석기 - (3) dataAccessContext-local.xml 분석 | 황제낙엽 | 2007.04.21 | 133 |
1 | Cugain의 샘플프로젝트 jpetstore 분석기 - (2) web.xml 분석 | 황제낙엽 | 2007.03.20 | 178 |