Spring动态切换多数据源Demo

上传者: wangpeng047 | 上传时间: 2015-02-03 00:00:00 | 文件大小: 19.4MB | 文件类型: rar
请自行修改com/resources/datasource.properties中数据库配置,Demo中配置的两个数据源,一个是Mysql,一个是Oracle。 运行之前请自行建立数据库的表。

文件下载

资源详情

[{"title":"( 98 个子文件 19.4MB ) Spring动态切换多数据源Demo","children":[{"title":"dynamicDatasourceDemo","children":[{"title":".settings","children":[{"title":"com.genuitec.eclipse.j2eedt.core.prefs <span style='color:#111;'> 1.02KB </span>","children":null,"spread":false},{"title":"org.eclipse.ltk.core.refactoring.prefs <span style='color:#111;'> 137B </span>","children":null,"spread":false},{"title":"org.eclipse.core.resources.prefs <span style='color:#111;'> 176B </span>","children":null,"spread":false},{"title":"org.eclipse.jdt.core.prefs <span style='color:#111;'> 330B </span>","children":null,"spread":false}],"spread":true},{"title":"src","children":[{"title":"com","children":[{"title":"core","children":[{"title":"DatabaseContextHolder.java <span style='color:#111;'> 406B </span>","children":null,"spread":false},{"title":"DataSourceInterceptor.java <span style='color:#111;'> 333B </span>","children":null,"spread":false},{"title":"DynamicDataSource.java <span style='color:#111;'> 290B </span>","children":null,"spread":false}],"spread":true},{"title":"dao","children":[{"title":"IStudentDao.java <span style='color:#111;'> 166B </span>","children":null,"spread":false},{"title":"impl","children":[{"title":"StudentDaoImpl.java <span style='color:#111;'> 716B </span>","children":null,"spread":false},{"title":"UserDaoImpl.java <span style='color:#111;'> 696B </span>","children":null,"spread":false}],"spread":true},{"title":"IUserDao.java <span style='color:#111;'> 184B </span>","children":null,"spread":false}],"spread":true},{"title":"pojo","children":[{"title":"po","children":[{"title":"User.java <span style='color:#111;'> 826B </span>","children":null,"spread":false},{"title":"Student.java <span style='color:#111;'> 839B </span>","children":null,"spread":false}],"spread":true},{"title":"vo","children":null,"spread":false}],"spread":true},{"title":"resources","children":[{"title":"validation_en_US.properties <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"springConfig-core.xml <span style='color:#111;'> 6.66KB </span>","children":null,"spread":false},{"title":"spring-mvc.xml <span style='color:#111;'> 2.67KB </span>","children":null,"spread":false},{"title":"datasource.properties <span style='color:#111;'> 904B </span>","children":null,"spread":false},{"title":"log4j.properties <span style='color:#111;'> 616B </span>","children":null,"spread":false},{"title":"validation_zh_CN.properties <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"ehcache.xml <span style='color:#111;'> 2.88KB </span>","children":null,"spread":false},{"title":"hibernate.cfg.xml <span style='color:#111;'> 1.19KB </span>","children":null,"spread":false}],"spread":true},{"title":"controller","children":[{"title":"oracle","children":[{"title":"UserController.java <span style='color:#111;'> 1.10KB </span>","children":null,"spread":false}],"spread":true},{"title":"mysql","children":[{"title":"StudentController.java <span style='color:#111;'> 1.20KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"service","children":[{"title":"IUserService.java <span style='color:#111;'> 192B </span>","children":null,"spread":false},{"title":"IStudentService.java <span style='color:#111;'> 174B </span>","children":null,"spread":false},{"title":"impl","children":[{"title":"UserServiceImpl.java <span style='color:#111;'> 538B </span>","children":null,"spread":false},{"title":"StudentServiceImpl.java <span style='color:#111;'> 543B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":".checkstyle <span style='color:#111;'> 310B </span>","children":null,"spread":false},{"title":".project <span style='color:#111;'> 1.26KB </span>","children":null,"spread":false},{"title":"WebRoot","children":[{"title":"META-INF","children":[{"title":"MANIFEST.MF <span style='color:#111;'> 36B </span>","children":null,"spread":false}],"spread":true},{"title":"WEB-INF","children":[{"title":"web.xml <span style='color:#111;'> 2.62KB </span>","children":null,"spread":false},{"title":"classes","children":[{"title":"com","children":[{"title":"core","children":[{"title":"DataSourceInterceptor.class <span style='color:#111;'> 702B </span>","children":null,"spread":false},{"title":"DatabaseContextHolder.class <span style='color:#111;'> 976B </span>","children":null,"spread":false},{"title":"DynamicDataSource.class <span style='color:#111;'> 544B </span>","children":null,"spread":false}],"spread":true},{"title":"dao","children":[{"title":"IUserDao.class <span style='color:#111;'> 284B </span>","children":null,"spread":false},{"title":"IStudentDao.class <span style='color:#111;'> 217B </span>","children":null,"spread":false},{"title":"impl","children":[{"title":"StudentDaoImpl.class <span style='color:#111;'> 1.33KB </span>","children":null,"spread":false},{"title":"UserDaoImpl.class <span style='color:#111;'> 1.30KB </span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"pojo","children":[{"title":"po","children":[{"title":"User.class <span style='color:#111;'> 1.18KB </span>","children":null,"spread":false},{"title":"Student.class <span style='color:#111;'> 1.18KB </span>","children":null,"spread":false}],"spread":false},{"title":"vo","children":null,"spread":false}],"spread":true},{"title":"resources","children":[{"title":"validation_en_US.properties <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"springConfig-core.xml <span style='color:#111;'> 6.66KB </span>","children":null,"spread":false},{"title":"spring-mvc.xml <span style='color:#111;'> 2.67KB </span>","children":null,"spread":false},{"title":"datasource.properties <span style='color:#111;'> 904B </span>","children":null,"spread":false},{"title":"log4j.properties <span style='color:#111;'> 616B </span>","children":null,"spread":false},{"title":"validation_zh_CN.properties <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"ehcache.xml <span style='color:#111;'> 2.88KB </span>","children":null,"spread":false},{"title":"hibernate.cfg.xml <span style='color:#111;'> 1.19KB </span>","children":null,"spread":false}],"spread":false},{"title":"controller","children":[{"title":"oracle","children":[{"title":"UserController.class <span style='color:#111;'> 1.79KB </span>","children":null,"spread":false}],"spread":false},{"title":"mysql","children":[{"title":"StudentController.class <span style='color:#111;'> 1.90KB </span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"service","children":[{"title":"IStudentService.class <span style='color:#111;'> 229B </span>","children":null,"spread":false},{"title":"IUserService.class <span style='color:#111;'> 296B </span>","children":null,"spread":false},{"title":"impl","children":[{"title":"StudentServiceImpl.class <span style='color:#111;'> 943B </span>","children":null,"spread":false},{"title":"UserServiceImpl.class <span style='color:#111;'> 969B </span>","children":null,"spread":false}],"spread":false}],"spread":false}],"spread":true}],"spread":true},{"title":"lib","children":[{"title":"hibernate-jpa-2.1-api-1.0.0.Final.jar <span style='color:#111;'> 110.71KB </span>","children":null,"spread":false},{"title":"spring-core-4.1.4.RELEASE.jar <span style='color:#111;'> 983.39KB </span>","children":null,"spread":false},{"title":"validation-api-1.1.0.Final.jar <span style='color:#111;'> 62.28KB </span>","children":null,"spread":false},{"title":"dom4j-1.6.1.jar <span style='color:#111;'> 306.54KB </span>","children":null,"spread":false},{"title":"spring-context-4.1.4.RELEASE.jar <span style='color:#111;'> 1002.03KB </span>","children":null,"spread":false},{"title":"hibernate-core-4.3.8.Final.jar <span style='color:#111;'> 5.03MB </span>","children":null,"spread":false},{"title":"mysql-connector-java-5.1.30-bin.jar <span style='color:#111;'> 931.68KB </span>","children":null,"spread":false},{"title":"spring-jdbc-4.1.4.RELEASE.jar <span style='color:#111;'> 416.70KB </span>","children":null,"spread":false},{"title":"aopalliance-1.0.jar <span style='color:#111;'> 4.36KB </span>","children":null,"spread":false},{"title":"antlr-2.7.7.jar <span style='color:#111;'> 434.85KB </span>","children":null,"spread":false},{"title":"spring-test-4.1.4.RELEASE.jar <span style='color:#111;'> 490.77KB </span>","children":null,"spread":false},{"title":"spring-beans-4.1.4.RELEASE.jar <span style='color:#111;'> 691.71KB </span>","children":null,"spread":false},{"title":"spring-aspects-4.1.4.RELEASE.jar <span style='color:#111;'> 55.52KB </span>","children":null,"spread":false},{"title":"spring-expression-4.1.4.RELEASE.jar <span style='color:#111;'> 252.74KB </span>","children":null,"spread":false},{"title":"spring-webmvc-portlet-4.1.4.RELEASE.jar <span style='color:#111;'> 172.71KB </span>","children":null,"spread":false},{"title":"slf4j-api-1.6.1.jar <span style='color:#111;'> 24.90KB </span>","children":null,"spread":false},{"title":"spring-web-4.1.4.RELEASE.jar <span style='color:#111;'> 697.70KB </span>","children":null,"spread":false},{"title":"ojdbc6.jar <span style='color:#111;'> 1.90MB </span>","children":null,"spread":false},{"title":"jboss-logging-annotations-1.2.0.Beta1.jar <span style='color:#111;'> 11.29KB </span>","children":null,"spread":false},{"title":"jandex-1.1.0.Final.jar <span style='color:#111;'> 74.76KB </span>","children":null,"spread":false},{"title":"spring-orm-4.1.4.RELEASE.jar <span style='color:#111;'> 367.50KB </span>","children":null,"spread":false},{"title":"jboss-logging-3.1.3.GA.jar <span style='color:#111;'> 55.84KB </span>","children":null,"spread":false},{"title":"javassist-3.18.1-GA.jar <span style='color:#111;'> 697.46KB </span>","children":null,"spread":false},{"title":"hibernate-ehcache-4.3.8.Final.jar <span style='color:#111;'> 132.39KB </span>","children":null,"spread":false},{"title":"commons-logging-1.1.3.jar <span style='color:#111;'> 60.60KB </span>","children":null,"spread":false},{"title":"spring-webmvc-4.1.4.RELEASE.jar <span style='color:#111;'> 763.43KB </span>","children":null,"spread":false},{"title":"ehcache-core-2.6.10.jar <span style='color:#111;'> 1.29MB </span>","children":null,"spread":false},{"title":"spring-context-support-4.1.4.RELEASE.jar <span style='color:#111;'> 173.93KB </span>","children":null,"spread":false},{"title":"classmate-1.0.0.jar <span style='color:#111;'> 58.87KB </span>","children":null,"spread":false},{"title":"hibernate-commons-annotations-4.0.5.Final.jar <span style='color:#111;'> 73.56KB </span>","children":null,"spread":false},{"title":"jboss-transaction-api_1.2_spec-1.0.0.Final.jar <span style='color:#111;'> 27.07KB </span>","children":null,"spread":false},{"title":"c3p0-0.9.5.jar <span style='color:#111;'> 476.91KB </span>","children":null,"spread":false},{"title":"spring-aop-4.1.4.RELEASE.jar <span style='color:#111;'> 350.68KB </span>","children":null,"spread":false},{"title":"mchange-commons-java-0.2.8.jar <span style='color:#111;'> 589.01KB </span>","children":null,"spread":false},{"title":"log4j-1.2.17.jar <span style='color:#111;'> 478.40KB </span>","children":null,"spread":false},{"title":"aspectjweaver-1.7.3.jar <span style='color:#111;'> 1.74MB </span>","children":null,"spread":false},{"title":"spring-tx-4.1.4.RELEASE.jar <span style='color:#111;'> 246.60KB </span>","children":null,"spread":false},{"title":"hibernate-validator-5.1.3.Final.jar <span style='color:#111;'> 619.40KB </span>","children":null,"spread":false},{"title":"hibernate-validator-annotation-processor-5.1.3.Final.jar <span style='color:#111;'> 62.88KB </span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"index.jsp <span style='color:#111;'> 890B </span>","children":null,"spread":false},{"title":"jsp","children":[{"title":"student.jsp <span style='color:#111;'> 2.53KB </span>","children":null,"spread":false},{"title":"user.jsp <span style='color:#111;'> 2.92KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":".mymetadata <span style='color:#111;'> 337B </span>","children":null,"spread":false},{"title":".classpath <span style='color:#111;'> 3.70KB </span>","children":null,"spread":false},{"title":".myeclipse","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

  • mengwenjun987 :
    主要是用来学习的
    2020-09-11
  • slxz001 :
    亲测有效。
    2020-04-20
  • freecodenow :
    确实挺好用的,学习到了!
    2020-03-12
  • sundoctor :
    非常感谢,感谢分享。
    2020-02-16
  • 伍良贵 :
    这个分有点贵呀
    2019-10-08

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明