欢迎来到天天文库
浏览记录
ID:37901327
大小:65.50 KB
页数:8页
时间:2019-06-02
《Spring配置多个数据源》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、配置多个数据源在开发当中,有时候需要的数据源不止一个,所以就需要配置数据源,也就是说需要不同数据库里的数据。废话少说,转入正题!一、框架SSI(Struts+Spring+Ibatis)二、主要的就是Spring的配置文件,其他的都是次要的三、我是将Spring的配置文件分开了,你只要参考我的改一下就行了四、spring的配置文件1、applicationContext_bean.xml2、beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:aop="http://www.springframework.org/schema/aop"xmlns:tx="http://www.springframework.org/schema/tx"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans3、-3.0.xsdhttp://www.springframework.org/schema/txhttp://www.springframework.org/schema/tx/spring-tx-3.0.xsdhttp://www.springframework.org/schema/aophttp://www.springframework.org/schema/aop/spring-aop-3.0.xsd">//.红色部分为重点,这里是核心,配置两个dateSource4、ngframework.jndi.JndiObjectFactoryBean">vspn53JNDIsxJNDIclasspath:sqlmap/sqlmap_base.xml7、classpath:sqlmap/sqlmap_base.xml8、Source">
2、beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:aop="http://www.springframework.org/schema/aop"xmlns:tx="http://www.springframework.org/schema/tx"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans
3、-3.0.xsdhttp://www.springframework.org/schema/txhttp://www.springframework.org/schema/tx/spring-tx-3.0.xsdhttp://www.springframework.org/schema/aophttp://www.springframework.org/schema/aop/spring-aop-3.0.xsd">//.红色部分为重点,这里是核心,配置两个dateSource4、ngframework.jndi.JndiObjectFactoryBean">vspn53JNDIsxJNDIclasspath:sqlmap/sqlmap_base.xml7、classpath:sqlmap/sqlmap_base.xml8、Source">
4、ngframework.jndi.JndiObjectFactoryBean">vspn53JNDIsxJNDIclasspath:sqlmap/sqlmap_base.xml
7、classpath:sqlmap/sqlmap_base.xml8、Source">
8、Source">
此文档下载收益归作者所有