springjndiCon02fig.xml.svn-base 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
  3. "http://www.springframework.org/dtd/spring-beans.dtd">
  4. <!-- <beans xmlns="http://www.springframework.org/schema/beans"
  5. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  6. xsi:schemaLocation="http://www.springframework.org/schema/beans
  7. http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> -->
  8. <beans>
  9. <bean id="dataSource"
  10. class="org.apache.commons.dbcp.BasicDataSource"
  11. destroy-method="close">
  12. <property name="driverClassName">
  13. <value>oracle.jdbc.driver.OracleDriver</value>
  14. </property>
  15. <property name="url">
  16. <value>jdbc:oracle:thin:@192.168.1.5:1521:corerdb</value><!-- jdbc:oracle:thin:@172.16.0.8:1521:SQMESDB -->
  17. </property>
  18. <property name="username">
  19. <value>core</value> <!--xg3q -->
  20. </property>
  21. <property name="password">
  22. <value>core</value> <!-- xg3q123 -->
  23. </property>
  24. <!-- 最大连接数据库连接数,设 0 为没有限制 -->
  25. <property name="maxActive">
  26. <value>100</value>
  27. </property>
  28. <!-- 最大等待连接中的数量,设 0 为没有限制 -->
  29. <property name="maxIdle">
  30. <value>20</value>
  31. </property>
  32. <!-- 最小等待连接中的数量 -->
  33. <property name="minIdle">
  34. <value>10</value>
  35. </property>
  36. <!-- 最大等待毫秒数, 单位为 ms, 超过时间会出错误信息 -->
  37. <property name="maxWait">
  38. <value>5000</value>
  39. </property>
  40. <!-- 最大等待连接中的数量,设 0 为没有限制 -->
  41. <property name="defaultAutoCommit">
  42. <value>true</value>
  43. </property>
  44. <!-- 回收被遗弃的(一般是忘了释放的)数据库连接到连接池中 -->
  45. <property name="removeAbandoned">
  46. <value>true</value>
  47. </property>
  48. <!-- 数据库连接过多长时间不用将被视为被遗弃而收回连接池中 -->
  49. <property name="removeAbandonedTimeout">
  50. <value>60</value>
  51. </property>
  52. <property name="logAbandoned">
  53. <value>true</value>
  54. </property>
  55. <property name="initialSize">
  56. <value>5</value>
  57. </property>
  58. </bean>
  59. <bean id="dataSource1"
  60. class="org.apache.commons.dbcp.BasicDataSource"
  61. destroy-method="close">
  62. <property name="driverClassName">
  63. <value>oracle.jdbc.driver.OracleDriver</value>
  64. </property>
  65. <property name="url">
  66. <value>jdbc:oracle:thin:@192.168.1.5:1521:orcl</value><!-- jdbc:oracle:thin:@172.16.0.8:1521:SQMESDB -->
  67. </property>
  68. <property name="username">
  69. <value>core</value> <!--xg3q -->
  70. </property>
  71. <property name="password">
  72. <value>core</value> <!-- xg3q123 -->
  73. </property>
  74. <!-- 最大连接数据库连接数,设 0 为没有限制 -->
  75. <property name="maxActive">
  76. <value>100</value>
  77. </property>
  78. <!-- 最大等待连接中的数量,设 0 为没有限制 -->
  79. <property name="maxIdle">
  80. <value>20</value>
  81. </property>
  82. <!-- 最小等待连接中的数量 -->
  83. <property name="minIdle">
  84. <value>10</value>
  85. </property>
  86. <!-- 最大等待毫秒数, 单位为 ms, 超过时间会出错误信息 -->
  87. <property name="maxWait">
  88. <value>5000</value>
  89. </property>
  90. <!-- 最大等待连接中的数量,设 0 为没有限制 -->
  91. <property name="defaultAutoCommit">
  92. <value>true</value>
  93. </property>
  94. <!-- 回收被遗弃的(一般是忘了释放的)数据库连接到连接池中 -->
  95. <property name="removeAbandoned">
  96. <value>true</value>
  97. </property>
  98. <!-- 数据库连接过多长时间不用将被视为被遗弃而收回连接池中 -->
  99. <property name="removeAbandonedTimeout">
  100. <value>60</value>
  101. </property>
  102. <property name="logAbandoned">
  103. <value>true</value>
  104. </property>
  105. <property name="initialSize">
  106. <value>5</value>
  107. </property>
  108. </bean>
  109. <bean id="jdbcTemplate"
  110. class="org.springframework.jdbc.core.JdbcTemplate">
  111. <property name="dataSource" ref="dataSource" />
  112. <!-- 设置抽取器 -->
  113. <property name="nativeJdbcExtractor" ref="nativeJdbcExtractor" />
  114. </bean>
  115. <bean id="jdbcTemplate1"
  116. class="org.springframework.jdbc.core.JdbcTemplate">
  117. <property name="dataSource" ref="dataSource1" />
  118. <!-- 设置抽取器 -->
  119. <property name="nativeJdbcExtractor" ref="nativeJdbcExtractor" />
  120. </bean>
  121. <bean id="nativeJdbcExtractor"
  122. class="org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor"
  123. lazy-init="true" />
  124. <bean id="oracleLobHandler"
  125. class="org.springframework.jdbc.support.lob.OracleLobHandler"
  126. lazy-init="true">
  127. <property name="nativeJdbcExtractor" ref="nativeJdbcExtractor" />
  128. <!-- ① 设置本地 Jdbc 对象抽取器 -->
  129. </bean>
  130. <bean id="KgDao" class="CoreFS.SA04.CoreDBProxy">
  131. <property name="jdbcTemplate" ref="jdbcTemplate" />
  132. <!-- ② 设置 LOB 处理器 -->
  133. <property name="lobHandler" ref="oracleLobHandler" />
  134. </bean>
  135. <bean id="coredao" class="CoreFS.SA04.CoreDBProxy">
  136. <property name="jdbcTemplate" ref="jdbcTemplate1" />
  137. <!-- ② 设置 LOB 处理器 -->
  138. <property name="lobHandler" ref="oracleLobHandler" />
  139. </bean>
  140. <!-- 实体类使用的Hibernate配置 -->
  141. <!-- Hibernate配置-->
  142. <bean id="sessionFactory"
  143. class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
  144. <property name="dataSource" ref="dataSource" />
  145. <property name="hibernateProperties">
  146. <props>
  147. <prop key="hibernate.dialect">
  148. org.hibernate.dialect.Oracle10gDialect
  149. </prop>
  150. <prop key="hibernate.default_batch_fetch_size">10</prop>
  151. <prop key="hibernate.max_fetch_depth">0</prop>
  152. <prop key="hibernate.show_sql">true</prop>
  153. </props>
  154. </property>
  155. <property name="mappingLocations">
  156. <list>
  157. <!-- <value>classpath:CoreBpm/Model/Hs_order_manager.hbm.xml</value>-->
  158. </list>
  159. </property>
  160. </bean>
  161. <bean id="transactionManager"
  162. class="org.springframework.orm.hibernate3.HibernateTransactionManager">
  163. <property name="sessionFactory" ref="sessionFactory" />
  164. </bean>
  165. <bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
  166. <property name="sessionFactory">
  167. <ref bean="sessionFactory"/>
  168. </property>
  169. <property name="allowCreate">
  170. <value>true</value>
  171. </property>
  172. </bean>
  173. <bean id="baseDao" class="CoreBpm.Util.BaseDao">
  174. <property name="hibernateTemplate">
  175. <ref bean="hibernateTemplate"/>
  176. </property>
  177. </bean>
  178. <!-- 工作流配置 -->
  179. <!-- jBPM configuration -->
  180. <!-- <bean id="JbpmConfiguration"
  181. class="org.springmodules.workflow.jbpm31.LocalJbpmConfigurationFactoryBean">
  182. <property name="configuration" value="classpath:jbpm.cfg.xml" />
  183. <property name="createSchema" value="false" />
  184. <property name="sessionFactory">
  185. <ref local="sessionFactory"/>
  186. </property>
  187. </bean>
  188. -->
  189. <!-- jBPM template -->
  190. <!-- <bean id="JbpmTemplate"
  191. class="org.springmodules.workflow.jbpm31.JbpmTemplate">
  192. <constructor-arg index="0" ref="JbpmConfiguration" />
  193. </bean> -->
  194. </beans>