${key}這樣的表達(dá)式在xml中,代表引入的PRoperties文件中key對(duì)應(yīng)的一個(gè)變量值
jdbc.properties文件
jdbcUrl=jdbc:MySQL:///itcastoa_20120216
driverClass=com.mysql.jdbc.Driver
username=root
passWord=root
applicationContext.xml文件
<!-- 加載外部的properties配置文件 -->
<context:property-placeholder location="classpath:jdbc.properties"/>
<!-- 配置數(shù)據(jù)庫(kù)連接池(c3po) --><bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"><!-- 基本信息 --><property name="jdbcUrl" value="${jdbcUrl}"></property><property name="driverClass" value="${driverClass}"></property><property name="user" value="${username}"></property><property name="password" value="${password}"></property>
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注