db-config.xml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. xsi:schemaLocation="
  5. http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
  6. <!-- 数据源 -->
  7. <bean id="UAS_MES" class="com.alibaba.druid.pool.DruidDataSource" destroy-method="close">
  8. <property name="driverClassName">
  9. <value>oracle.jdbc.driver.OracleDriver</value>
  10. </property>
  11. <property name="url">
  12. <value>jdbc:oracle:thin:@usoft.f3322.net:11618:orcl</value>
  13. </property>
  14. <property name="username">
  15. <value>UAS_MES</value>
  16. </property>
  17. <property name="password" value="select!#%*(" />
  18. </bean>
  19. <!-- 将需要用到的多个帐套的dataSource定义在此,再通过multiDataSource切换 -->
  20. <bean id="dataSource" class="com.uas.mes.core.data.MultiDataSource">
  21. <property name="dataSource">
  22. <ref bean="#{about.defaultSob}" />
  23. </property>
  24. <!-- 配置connectTimeout 和 socketTimeout (防止发生网络异常时,spring jdbcTemplate无法捕捉,可能无限等待) -->
  25. <property name="connectionProperties"
  26. value="oracle.net.CONNECT_TIMEOUT=6000;oracle.jdbc.ReadTimeout=6000" />
  27. </bean>
  28. <!-- 操作LOB 数据 -->
  29. <bean id="lobHandler" class="org.springframework.jdbc.support.lob.DefaultLobHandler"
  30. lazy-init="true" />
  31. <!-- jbpm配置文件 -->
  32. <bean id="springHelper" class="org.jbpm.pvm.internal.processengine.SpringHelper">
  33. <property name="jbpmCfg" value="jbpm.cfg.xml"></property>
  34. </bean>
  35. <bean id="processEngine" factory-bean="springHelper"
  36. factory-method="createProcessEngine">
  37. </bean>
  38. <bean id="repositoryService" factory-bean="processEngine"
  39. factory-method="getRepositoryService" />
  40. <bean id="executionService" factory-bean="processEngine"
  41. factory-method="getExecutionService" />
  42. <bean id="historyService" factory-bean="processEngine"
  43. factory-method="getHistoryService" />
  44. <bean id="managementService" factory-bean="processEngine"
  45. factory-method="getManagementService" />
  46. <bean id="identityService" factory-bean="processEngine"
  47. factory-method="getIdentityService" />
  48. <bean id="taskService" factory-bean="processEngine"
  49. factory-method="getTaskService" />
  50. <bean id="sessionFactory"
  51. class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
  52. <property name="dataSource" ref="#{about.defaultSob}" />
  53. <property name="hibernateProperties">
  54. <props>
  55. <prop key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop>
  56. <prop key="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</prop>
  57. <prop key="hibernate.format_sql">true</prop>
  58. </props>
  59. </property>
  60. <property name="mappingResources">
  61. <list>
  62. <value>jbpm.repository.hbm.xml</value>
  63. <value>jbpm.execution.hbm.xml</value>
  64. <value>jbpm.history.hbm.xml</value>
  65. <value>jbpm.task.hbm.xml</value>
  66. <value>jbpm.identity.hbm.xml</value>
  67. </list>
  68. </property>
  69. </bean>
  70. </beans>