<? xml version ="1.0" encoding ="UTF-8" ?> < beans xmlns ="http://www.springframework.org/schema/beans" xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance" xmlns:context ="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd" > < context:property-placeholder location ="classpath:db-connection.properties" /> <!-- 国际化资源 <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"> <property name="basenames"> <value>com/esc/message</value> </property> </bean>--> < bean id ="dataSource" class ="org.logicalcobwebs.proxool.ProxoolDataSource" destroy-method="" > < property name ="driver" > < value >com.mysql.jdbc.Driver </ value > </ property > <!-- 这个属性也留到org.logicalcobwebs.proxool.ProxoolDataSource的getDriverUrl里去取了 --> <!-- <property name="driverUrl"> <value>${db.driverUrl}</value> --> <!-- <value>jdbc:oracle:thin:newcrm/newcrm@192.88.88.36:1521:crmtest</value> <value>jdbc:oracle:thin:crm/crm@192.88.88.36:1521:crmtest</value> <value>jdbc:oracle:thin:crm/crmdeng1234@(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = dddb1)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = dddb2)(PORT = 1521)) (LOAD_BALANCE = yes) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ddcrm.domain.com) (FAILOVER_MODE = (TYPE = SELECT) (METHOD = BASIC) (RETRIES = 30) (DELAY = 5) ) ) ) </value>--> <!-- </property> --> < property name ="user" > < value >${db.user} </ value > </ property > < property name ="password" > < value >${db.password} </ value > </ property > < property name ="alias" > < value >${db.alias} </ value > </ property > < property name ="houseKeepingSleepTime" > < value type ="long" >${db.houseKeepingSleepTime} </ value > </ property > < property name ="prototypeCount" > < value >${db.prototypeCount} </ value > </ property > < property name ="maximumConnectionCount" > < value >${db.maximumConnectionCount} </ value > </ property > < property name ="minimumConnectionCount" > < value >${db.minimumConnectionCount} </ value > </ property > < property name ="trace" > < value >${db.trace} </ value > </ property > < property name ="verbose" > < value >${db.verbose} </ value > </ property > < property name ="maximumConnectionLifetime" > < value >${db.maximumConnectionLifetime} </ value > </ property > < property name ="simultaneousBuildThrottle" > < value >${db.simultaneousBuildThrottle} </ value > </ property > < property name ="recentlyStartedThreshold" > < value >${db.recentlyStartedThreshold} </ value > </ property > < property name ="overloadWithoutRefusalLifetime" > < value >${db.overloadWithoutRefusalLifetime} </ value > </ property > < property name ="statistics" > < value >${db.statistics} </ value > </ property > < property name ="statisticsLogLevel" > < value >${db.statisticsLogLevel} </ value > </ property > < property name ="maximumActiveTime" > < value >${db.maximumActiveTime} </ value > </ property > </ bean > 。。。 。。。
db-connection.properties的部分内容:
db.user=root db.password=architect #db.password=123456 db.alias=dataSource #\u81ea\u52a8\u4fa6\u5bdf\u5404\u4e2a\u8fde\u63a5\u72b6\u6001\u7684\u65f6\u95f4\u95f4\u9694(\u6beb\u79d2),\u4fa6\u5bdf\u5230\u7a7a\u95f2\u7684\u8fde\u63a5\u5c31\u9a6c\u4e0a\u56de\u6536,\u8d85\u65f6\u7684\u9500\u6bc1 \u9ed8\u8ba430\u79d2\uff09 db.houseKeepingSleepTime=90000 #\u6700\u5c11\u4fdd\u6301\u7684\u7a7a\u95f2\u8fde\u63a5\u6570 db.prototypeCount=5 db.maximumConnectionCount=30 db.minimumConnectionCount=10 db.trace=true db.verbose=true #\u8fde\u63a5\u6700\u5927\u751f\u547d\u65f6\u95f4 \u9ed8\u8ba44\u5c0f\u65f6 db.maximumConnectionLifetime=14400000 #\u5141\u8bb8\u540c\u65f6\u65b0\u589e\u7684\u8fde\u63a5\u6570 db.simultaneousBuildThrottle=20 db.recentlyStartedThreshold=40000 db.overloadWithoutRefusalLifetime=50000 db.statistics=10s,1m,1d db.statisticsLogLevel=ERROR #\u8fde\u63a5\u6700\u5927\u6d3b\u52a8\u65f6\u95f4 \u9ed8\u8ba41\u5c0f\u65f6 db.maximumActiveTime=3600000 db.houseKeepingTestSql=select 1 from dual