관리 메뉴

moozi

root-context.xml 본문

TIS_2017/응용sw_2기

root-context.xml

moozi 2017. 10. 16. 10:30

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:context="http://www.springframework.org/schema/context"
 xmlns:mybatis-spring="http://mybatis.org/schema/mybatis-spring"
 xsi:schemaLocation="http://mybatis.org/schema/mybatis-spring http://mybatis.org/schema/mybatis-spring-1.2.xsd
  http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd">
 
 <!-- Root Context: defines shared resources visible to all other web components -->
 <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
  <property name="driverClassName" value="net.sf.log4jdbc.sql.jdbcapi.DriverSpy"></property>
  <property name="url" value="jdbc:log4jdbc:mysql://127.0.0.1:3306/book_ex?useSSL=false&amp;serverTimezone=UTC"></property>
  <property name="username" value="hkd"></property>
  <property name="password" value="1234"></property>
 </bean> 
 
 <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
  <property name="dataSource" ref="dataSource"></property>
  <property name="configLocation" value="classpath:/mybatis-config.xml"></property>
  <property name="mapperLocations" value="classpath:mappers/**/*Mapper.xml"></property>
 </bean>
 <bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate" destroy-method="clearCache">
  <constructor-arg name="sqlSessionFactory" ref="sqlSessionFactory"></constructor-arg>
 </bean>
 
 <context:component-scan base-package="org.zerock.persistence"></context:component-scan> 
</beans>

'TIS_2017 > 응용sw_2기' 카테고리의 다른 글

스프링연습문제01  (0) 2017.10.16
ex01  (0) 2017.10.16
안드로이드연습문제12  (0) 2017.10.10
customerSearch.jsp  (0) 2017.09.29
안드로이드연습문제11(미니프로젝트)  (0) 2017.09.26
0 Comments
댓글쓰기 폼