behosoft-edimiddledb.xml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:context="http://www.springframework.org/schema/context"
  5. xsi:schemaLocation="http://www.springframework.org/schema/beans
  6. http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
  7. http://www.springframework.org/schema/context
  8. http://www.springframework.org/schema/context/spring-context-2.5.xsd">
  9. <bean id="clis"
  10. class="org.springframework.jdbc.datasource.DriverManagerDataSource">
  11. <property name="driverClassName" value="com.mysql.jdbc.Driver" />
  12. <property name="url" value="jdbc:mysql://localhost:3306/clis" />
  13. <property name="username" value="root" />
  14. <property name="password" value="root" />
  15. </bean>
  16. <!-- 享佳订单系统 -->
  17. <bean id="xiangjiadb" class="com.mchange.v2.c3p0.ComboPooledDataSource"
  18. destroy-method="close">
  19. <property name="driverClass" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />
  20. <property name="user" value="sa" />
  21. <property name="password" value="sa_2013" />
  22. <property name="jdbcUrl" value="jdbc:sqlserver://BEHO-157:1433;databasename=edi_db" />
  23. <property name="initialPoolSize" value="10" />
  24. <property name="maxIdleTime" value="30" />
  25. <property name="maxPoolSize" value="100" />
  26. <property name="minPoolSize" value="10" />
  27. </bean>
  28. <!-- DPS系统 -->
  29. <bean id="xiangjiadps" class="com.mchange.v2.c3p0.ComboPooledDataSource"
  30. destroy-method="close">
  31. <property name="driverClass" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />
  32. <property name="user" value="root" />
  33. <property name="password" value="root" />
  34. <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/dps?characterEncoding=utf8" />
  35. <property name="initialPoolSize" value="10" />
  36. <property name="maxIdleTime" value="30" />
  37. <property name="maxPoolSize" value="100" />
  38. <property name="minPoolSize" value="10" />
  39. </bean>
  40. <!-- 编写spring 配置文件的配置多数源映射关系 -->
  41. <bean class="com.behosoft.edi.middledb.common.DynamicDataSource" id="dataSource1">
  42. <property name="targetDataSources">
  43. <map key-type="java.lang.String">
  44. <entry value-ref="clis" key="EbhLis"></entry>
  45. <entry value-ref="xiangjiadb" key="xiangjia"></entry>
  46. <entry value-ref="xiangjiadps" key="xiangjiadps"></entry>
  47. </map>
  48. </property>
  49. <property name="defaultTargetDataSource" ref="xiangjiadb">
  50. </property>
  51. </bean>
  52. <bean id="simpleJdbcTemplate" class="org.springframework.jdbc.core.simple.SimpleJdbcTemplate"><!--datasource自已配的 -->
  53. <constructor-arg ref="dataSource1" />
  54. </bean>
  55. </beans>