springjndiConfig.xml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502
  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="ds-1" class="org.springframework.jndi.JndiObjectFactoryBean">
  10. <property name="jndiName" value="jdbc/test"/>
  11. <property name="resourceRef" value="true"/>
  12. </bean-->
  13. <bean id="dataSource"
  14. class="org.apache.commons.dbcp.BasicDataSource"
  15. destroy-method="close">
  16. <property name="driverClassName">
  17. <value>oracle.jdbc.driver.OracleDriver</value>
  18. </property>
  19. <property name="url">
  20. <!-- 测试 -->
  21. <!--<value>jdbc:oracle:thin:@172.16.2.126:1521:tgjhy</value>-->
  22. <!-- 真实 -->
  23. <!-- <value>jdbc:oracle:thin:@192.168.10.31:1521/TGCXDB</value>-->
  24. <value>jdbc:oracle:thin:@172.54.11.30:1521/TGCXDB</value>
  25. <!-- <value>jdbc:oracle:thin:@192.168.10.31:1521:tgcxdb1</value> -->
  26. </property>
  27. <property name="username">
  28. <value>LIMSUSER</value>
  29. <!--<value>LIMSUSER</value>-->
  30. </property>
  31. <property name="password">
  32. <!--<value>cxuser</value>-->
  33. <!--<value>limsuser_2015</value>-->
  34. <value>lis91573</value>
  35. </property>
  36. <!-- 最大连接数据库连接数,设 0 为没有限制 -->
  37. <property name="maxActive">
  38. <value>30</value>
  39. </property>
  40. <!-- 最大等待连接中的数量,设 0 为没有限制 -->
  41. <property name="maxIdle">
  42. <value>15</value>
  43. </property>
  44. <!-- 最小等待连接中的数量 -->
  45. <property name="minIdle">
  46. <value>10</value>
  47. </property>
  48. <!-- 最大等待毫秒数, 单位为 ms, 超过时间会出错误信息 -->
  49. <property name="maxWait">
  50. <value>5000</value>
  51. </property>
  52. <!-- 最大等待连接中的数量,设 0 为没有限制 -->
  53. <property name="defaultAutoCommit">
  54. <value>true</value>
  55. </property>
  56. <!-- 回收被遗弃的(一般是忘了释放的)数据库连接到连接池中 -->
  57. <property name="removeAbandoned">
  58. <value>true</value>
  59. </property>
  60. <!-- 数据库连接过多长时间不用将被视为被遗弃而收回连接池中 -->
  61. <property name="removeAbandonedTimeout">
  62. <value>60</value>
  63. </property>
  64. <property name="logAbandoned">
  65. <value>true</value>
  66. </property>
  67. <property name="initialSize">
  68. <value>5</value>
  69. </property>
  70. <!-- sql 心跳 在数据库重启后确保重连-->
  71. <property name= "testWhileIdle" value="true"/>
  72. <property name= "testOnBorrow" value="false"/>
  73. <property name= "testOnReturn" value="false"/>
  74. <property name= "validationQuery" value="select * from dual"/>
  75. <property name= "timeBetweenEvictionRunsMillis" value="60000"/>
  76. <property name= "numTestsPerEvictionRun" value="10"/>
  77. <!-- property name= "validationQueryTimeout" value="1" />-->
  78. </bean>
  79. <bean id="dataSource1"
  80. class="org.apache.commons.dbcp.BasicDataSource"
  81. destroy-method="close">
  82. <property name="driverClassName">
  83. <value>oracle.jdbc.driver.OracleDriver</value>
  84. </property>
  85. <property name="url">
  86. <!-- 测试(连接产销数据库) -->
  87. <!--<value>jdbc:oracle:thin:@172.16.2.128:1521:tgcxtest</value>-->
  88. <!-- 真实(连接产销数据库) -->
  89. <!-- <value>jdbc:oracle:thin:@172.16.2.105:1521/tgcxdb</value>-->
  90. <value>jdbc:oracle:thin:@172.54.11.30:1521/TGCXDB</value>
  91. <!-- <value>jdbc:oracle:thin:@192.168.10.31:1521/TGCXDB</value> -->
  92. </property>
  93. <property name="username">
  94. <value>cxuser</value>
  95. </property>
  96. <property name="password">
  97. <!-- 测试 -->
  98. <!--<value>cxuser</value>-->
  99. <!-- 真实 -->
  100. <value>usr5581</value>
  101. <!--<value>tgusercx_2275</value>-->
  102. </property>
  103. <!-- 最大连接数据库连接数,设 0 为没有限制 -->
  104. <property name="maxActive">
  105. <value>20</value>
  106. </property>
  107. <!-- 最大等待连接中的数量,设 0 为没有限制 -->
  108. <property name="maxIdle">
  109. <value>15</value>
  110. </property>
  111. <!-- 最小等待连接中的数量 -->
  112. <property name="minIdle">
  113. <value>10</value>
  114. </property>
  115. <!-- 最大等待毫秒数, 单位为 ms, 超过时间会出错误信息 -->
  116. <property name="maxWait">
  117. <value>5000</value>
  118. </property>
  119. <!-- 最大等待连接中的数量,设 0 为没有限制 -->
  120. <property name="defaultAutoCommit">
  121. <value>true</value>
  122. </property>
  123. <!-- 回收被遗弃的(一般是忘了释放的)数据库连接到连接池中 -->
  124. <property name="removeAbandoned">
  125. <value>true</value>
  126. </property>
  127. <!-- 数据库连接过多长时间不用将被视为被遗弃而收回连接池中 -->
  128. <property name="removeAbandonedTimeout">
  129. <value>60</value>
  130. </property>
  131. <property name="logAbandoned">
  132. <value>true</value>
  133. </property>
  134. <property name="initialSize">
  135. <value>5</value>
  136. </property>
  137. </bean>
  138. <bean id="dataSource2"
  139. class="org.apache.commons.dbcp.BasicDataSource"
  140. destroy-method="close">
  141. <property name="driverClassName">
  142. <value>com.microsoft.sqlserver.jdbc.SQLServerDriver</value>
  143. </property>
  144. <property name="url">
  145. <!-- 测试 -->
  146. <!--<value>jdbc:sqlserver://127.0.0.1:1433;DatabaseName=TPCO</value>-->
  147. <!-- 正式 -->
  148. <value>jdbc:sqlserver://172.16.2.9:1433;DatabaseName=TPCO_SCYPD</value>
  149. </property>
  150. <property name="username">
  151. <value>cx</value>
  152. </property>
  153. <property name="password">
  154. <value>tgcx</value>
  155. </property>
  156. <!-- 最大连接数据库连接数,设 0 为没有限制 -->
  157. <property name="maxActive">
  158. <value>20</value>
  159. </property>
  160. <!-- 最大等待连接中的数量,设 0 为没有限制 -->
  161. <property name="maxIdle">
  162. <value>10</value>
  163. </property>
  164. <!-- 最小等待连接中的数量 -->
  165. <property name="minIdle">
  166. <value>5</value>
  167. </property>
  168. <!-- 最大等待毫秒数, 单位为 ms, 超过时间会出错误信息 -->
  169. <property name="maxWait">
  170. <value>5000</value>
  171. </property>
  172. <!-- 最大等待连接中的数量,设 0 为没有限制 -->
  173. <property name="defaultAutoCommit">
  174. <value>true</value>
  175. </property>
  176. <!-- 回收被遗弃的(一般是忘了释放的)数据库连接到连接池中 -->
  177. <property name="removeAbandoned">
  178. <value>true</value>
  179. </property>
  180. <!-- 数据库连接过多长时间不用将被视为被遗弃而收回连接池中 -->
  181. <property name="removeAbandonedTimeout">
  182. <value>60</value>
  183. </property>
  184. <property name="logAbandoned">
  185. <value>true</value>
  186. </property>
  187. <property name="initialSize">
  188. <value>5</value>
  189. </property>
  190. </bean>
  191. <bean id="dataSource3" class="org.apache.commons.dbcp.BasicDataSource"
  192. destroy-method="close">
  193. <property name="driverClassName">
  194. <value>oracle.jdbc.driver.OracleDriver</value>
  195. </property>
  196. <property name="url">
  197. <!-- 测试(连接采购数据库) -->
  198. <!--<value>jdbc:oracle:thin:@172.16.2.128:1521:tgcxtest</value>-->
  199. <!-- 真实(连接采购数据库) -->
  200. <value>jdbc:oracle:thin:@172.16.2.138:1521:cgdb</value>
  201. </property>
  202. <property name="username">
  203. <!-- 测试 -->
  204. <!--<value>cxuser</value>-->
  205. <!-- 真实 -->
  206. <value>pmsuser</value>
  207. </property>
  208. <property name="password">
  209. <!-- 测试 -->
  210. <!--<value>cxuser</value>-->
  211. <!-- 真实 -->
  212. <value>pmsuser_2015</value>
  213. </property>
  214. <!-- 最大连接数据库连接数,设 0 为没有限制 -->
  215. <property name="maxActive">
  216. <value>20</value>
  217. </property>
  218. <!-- 最大等待连接中的数量,设 0 为没有限制 -->
  219. <property name="maxIdle">
  220. <value>10</value>
  221. </property>
  222. <!-- 最小等待连接中的数量 -->
  223. <property name="minIdle">
  224. <value>5</value>
  225. </property>
  226. <!-- 最大等待毫秒数, 单位为 ms, 超过时间会出错误信息 -->
  227. <property name="maxWait">
  228. <value>5000</value>
  229. </property>
  230. <!-- 最大等待连接中的数量,设 0 为没有限制 -->
  231. <property name="defaultAutoCommit">
  232. <value>true</value>
  233. </property>
  234. <!-- 回收被遗弃的(一般是忘了释放的)数据库连接到连接池中 -->
  235. <property name="removeAbandoned">
  236. <value>true</value>
  237. </property>
  238. <!-- 数据库连接过多长时间不用将被视为被遗弃而收回连接池中 -->
  239. <property name="removeAbandonedTimeout">
  240. <value>60</value>
  241. </property>
  242. <property name="logAbandoned">
  243. <value>true</value>
  244. </property>
  245. <property name="initialSize">
  246. <value>5</value>
  247. </property>
  248. </bean>
  249. <bean id="PhyCollectdataSource"
  250. class="org.apache.commons.dbcp.BasicDataSource"
  251. destroy-method="close">
  252. <property name="driverClassName">
  253. <value>com.microsoft.sqlserver.jdbc.SQLServerDriver</value>
  254. </property>
  255. <property name="url">
  256. <value>jdbc:sqlserver://172.16.2.141;DatabaseName=fmis_data</value>
  257. </property>
  258. <property name="username">
  259. <value>sa</value>
  260. </property>
  261. <property name="password">
  262. <value>tpcims</value>
  263. </property>
  264. <!-- 最大连接数据库连接数,设 0 为没有限制 -->
  265. <property name="maxActive">
  266. <value>20</value>
  267. </property>
  268. <!-- 最大等待连接中的数量,设 0 为没有限制 -->
  269. <property name="maxIdle">
  270. <value>10</value>
  271. </property>
  272. <!-- 最小等待连接中的数量 -->
  273. <property name="minIdle">
  274. <value>5</value>
  275. </property>
  276. <!-- 最大等待毫秒数, 单位为 ms, 超过时间会出错误信息 -->
  277. <property name="maxWait">
  278. <value>5000</value>
  279. </property>
  280. <!-- 最大等待连接中的数量,设 0 为没有限制 -->
  281. <property name="defaultAutoCommit">
  282. <value>true</value>
  283. </property>
  284. <!-- 回收被遗弃的(一般是忘了释放的)数据库连接到连接池中 -->
  285. <property name="removeAbandoned">
  286. <value>true</value>
  287. </property>
  288. <!-- 数据库连接过多长时间不用将被视为被遗弃而收回连接池中 -->
  289. <property name="removeAbandonedTimeout">
  290. <value>60</value>
  291. </property>
  292. <property name="logAbandoned">
  293. <value>true</value>
  294. </property>
  295. <property name="initialSize">
  296. <value>5</value>
  297. </property>
  298. </bean>
  299. <bean id="PhyCollectdataSourceTH"
  300. class="org.apache.commons.dbcp.BasicDataSource"
  301. destroy-method="close">
  302. <property name="driverClassName">
  303. <value>com.microsoft.sqlserver.jdbc.SQLServerDriver</value>
  304. </property>
  305. <property name="url">
  306. <value>jdbc:sqlserver://172.17.110.4;DatabaseName=fiml_data</value>
  307. </property>
  308. <property name="username">
  309. <value>jhy</value>
  310. </property>
  311. <property name="password">
  312. <value>Jhy@2020</value>
  313. </property>
  314. <!-- 最大连接数据库连接数,设 0 为没有限制 -->
  315. <property name="maxActive">
  316. <value>20</value>
  317. </property>
  318. <!-- 最大等待连接中的数量,设 0 为没有限制 -->
  319. <property name="maxIdle">
  320. <value>10</value>
  321. </property>
  322. <!-- 最小等待连接中的数量 -->
  323. <property name="minIdle">
  324. <value>5</value>
  325. </property>
  326. <!-- 最大等待毫秒数, 单位为 ms, 超过时间会出错误信息 -->
  327. <property name="maxWait">
  328. <value>5000</value>
  329. </property>
  330. <!-- 最大等待连接中的数量,设 0 为没有限制 -->
  331. <property name="defaultAutoCommit">
  332. <value>true</value>
  333. </property>
  334. <!-- 回收被遗弃的(一般是忘了释放的)数据库连接到连接池中 -->
  335. <property name="removeAbandoned">
  336. <value>true</value>
  337. </property>
  338. <!-- 数据库连接过多长时间不用将被视为被遗弃而收回连接池中 -->
  339. <property name="removeAbandonedTimeout">
  340. <value>60</value>
  341. </property>
  342. <property name="logAbandoned">
  343. <value>true</value>
  344. </property>
  345. <property name="initialSize">
  346. <value>5</value>
  347. </property>
  348. </bean>
  349. <bean id="jdbcTemplate"
  350. class="org.springframework.jdbc.core.JdbcTemplate">
  351. <property name="dataSource" ref="dataSource" />
  352. <!-- 设置抽取器 -->
  353. <property name="nativeJdbcExtractor" ref="nativeJdbcExtractor" />
  354. </bean>
  355. <bean id="jdbcTemplate1"
  356. class="org.springframework.jdbc.core.JdbcTemplate">
  357. <property name="dataSource" ref="dataSource1" />
  358. <!-- 设置抽取器 -->
  359. <property name="nativeJdbcExtractor" ref="nativeJdbcExtractor" />
  360. </bean>
  361. <bean id="jdbcTemplate2"
  362. class="org.springframework.jdbc.core.JdbcTemplate">
  363. <property name="dataSource" ref="dataSource2" />
  364. <!-- 设置抽取器 -->
  365. <property name="nativeJdbcExtractor" ref="nativeJdbcExtractor" />
  366. </bean>
  367. <bean id="jdbcTemplate3" class="org.springframework.jdbc.core.JdbcTemplate">
  368. <property name="dataSource" ref="dataSource3" />
  369. <!-- 设置抽取器 -->
  370. <property name="nativeJdbcExtractor" ref="nativeJdbcExtractor" />
  371. </bean>
  372. <bean id="PhyCollectjdbcTemplate"
  373. class="org.springframework.jdbc.core.JdbcTemplate">
  374. <property name="dataSource" ref="PhyCollectdataSource" />
  375. <!-- 设置抽取器 -->
  376. <!-- <property name="nativeJdbcExtractor" ref="nativeJdbcExtractor" /> -->
  377. </bean>
  378. <bean id="PhyCollectjdbcTemplateTH"
  379. class="org.springframework.jdbc.core.JdbcTemplate">
  380. <property name="dataSource" ref="PhyCollectdataSourceTH" />
  381. <!-- 设置抽取器 -->
  382. <!-- <property name="nativeJdbcExtractor" ref="nativeJdbcExtractor" /> -->
  383. </bean>
  384. <bean id="defaultLobHandler"
  385. class="org.springframework.jdbc.support.lob.DefaultLobHandler"
  386. lazy-init="true">
  387. </bean>
  388. <bean id="nativeJdbcExtractor"
  389. class="org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor"
  390. lazy-init="true" />
  391. <bean id="oracleLobHandler"
  392. class="org.springframework.jdbc.support.lob.OracleLobHandler"
  393. lazy-init="true">
  394. <property name="nativeJdbcExtractor" ref="nativeJdbcExtractor" />
  395. <!-- ① 设置本地 Jdbc 对象抽取器 -->
  396. </bean>
  397. <bean id="TgDao" class="CoreFS.SA04.CoreDBProxy">
  398. <property name="jdbcTemplate" ref="jdbcTemplate" />
  399. <!-- ② 设置 LOB 处理器 -->
  400. <property name="lobHandler" ref="oracleLobHandler" />
  401. </bean>
  402. <bean id="TGCXDao" class="CoreFS.SA04.CoreDBProxy">
  403. <property name="jdbcTemplate" ref="jdbcTemplate1" />
  404. <!-- ② 设置 LOB 处理器 -->
  405. <property name="lobHandler" ref="oracleLobHandler" />
  406. </bean>
  407. <bean id="ZBSQLDao" class="CoreFS.SA04.CoreDBProxy">
  408. <property name="jdbcTemplate" ref="jdbcTemplate2" />
  409. <!-- ② 设置 LOB 处理器 -->
  410. <property name="lobHandler" ref="oracleLobHandler" />
  411. </bean>
  412. <bean id="TGCGDao" class="CoreFS.SA04.CoreDBProxy">
  413. <property name="jdbcTemplate" ref="jdbcTemplate3" />
  414. <!-- ② 设置 LOB 处理器 -->
  415. <property name="lobHandler" ref="oracleLobHandler" />
  416. </bean>
  417. <bean id="PhyCollectDao" class="CoreFS.SA04.CoreDBProxy">
  418. <property name="jdbcTemplate" ref="PhyCollectjdbcTemplate" />
  419. <!-- ② 设置 LOB 处理器 -->
  420. <property name="lobHandler" ref="defaultLobHandler" />
  421. </bean>
  422. <bean id="PhyCollectDaoTH" class="CoreFS.SA04.CoreDBProxy">
  423. <property name="jdbcTemplate" ref="PhyCollectjdbcTemplateTH" />
  424. <!-- ② 设置 LOB 处理器 -->
  425. <property name="lobHandler" ref="defaultLobHandler" />
  426. </bean>
  427. <!-- 实体类使用的Hibernate配置 -->
  428. <!-- Hibernate配置-->
  429. <bean id="sessionFactory"
  430. class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
  431. <property name="dataSource" ref="dataSource" />
  432. <!-- property name="typeDefinitions" ref="jbpmTypes"/-->
  433. <property name="hibernateProperties">
  434. <props>
  435. <prop key="hibernate.dialect">
  436. org.hibernate.dialect.Oracle10gDialect
  437. </prop>
  438. <prop key="hibernate.default_batch_fetch_size">10</prop>
  439. <prop key="hibernate.max_fetch_depth">0</prop>
  440. <prop key="hibernate.show_sql">true</prop>
  441. </props>
  442. </property>
  443. </bean>
  444. <bean id="transactionManager"
  445. class="org.springframework.orm.hibernate3.HibernateTransactionManager">
  446. <property name="sessionFactory" ref="sessionFactory" />
  447. </bean>
  448. <bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
  449. <property name="sessionFactory">
  450. <ref bean="sessionFactory"/>
  451. </property>
  452. <property name="allowCreate">
  453. <value>true</value>
  454. </property>
  455. </bean>
  456. <bean id="baseDao" class="CoreBpm.Util.BaseDao">
  457. <property name="hibernateTemplate">
  458. <ref bean="hibernateTemplate"/>
  459. </property>
  460. <!-- <property name="jbpmTemplate">
  461. <ref bean="jbpmTemplate"/>
  462. </property>-->
  463. </bean>
  464. <bean id="sqlSessionFactory" class="CoreFS.SE01.CoreSqlSessionFactoryBean">
  465. <property name="configLocation" value="classpath:configuration.xml"></property>
  466. <property name="database" value="Oracle" />
  467. <property name="dataSource" ref="dataSource" />
  468. <property name="mapperLocations" value="classpath:com/steering/mapper/"></property>
  469. </bean>
  470. </beans>