aplictaioncontext-datasource的配置:
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" xmlns:jee="http://www.springframework.org/schema/jee" 4 xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context" 5 xmlns:jpa="http://www.springframework.org/schema/data/jpa" 6 xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.1.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd"> 7 8 <bean id="propertyConfigurer" 9 class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">10 <property name="locations">11 <list>12 <value>classpath:config.properties</value>13 </list>14 </property>15 </bean>16 17 <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"18 destroy-method="close">19 <property name="driverClassName">20 <value>${sqlDriver}</value>21 </property>22 <property name="url">23 <value>${sqlUrl}</value>24 </property>25 <property name="username">26 <value>${sqlUserName}</value>27 </property>28 <property name="password">29 <value>${sqlPassword}</value>30 </property>31 <property name="maxActive">32 <value>${sqlMaxActive}</value>33 </property>34 <property name="maxWait">35 <value>${sqlMaxWait}</value>36 </property>37 <property name="maxIdle">38 <value>${sqlMaxIdle}</value>39 </property>40 </bean>41 42 </beans>propertyConfigurer用来配置用到的config.properties文件的位置,方便在datasource配置中引用。<br />config配置文件的写法如下:<br />
1 sqlDriver=com.mysql.jdbc.Driver2 sqlUrl=jdbc:mysql://127.0.0.1:3306/mydatabase?useUnicode=true&characterEncoding=utf83 sqlUserName=root4 sqlPassword=1235 sqlMaxActive=5006 sqlMaxWait=10007 sqlMaxIdle=50
SHOPEX酷黑商城整站源码.程序基于SHOPEX4.8.5 最新版制作. 安装方法: 1.解压上传程序至网站根目录.. 访问:域名/bak.(用户名:admin 密码:123456) 2.进入帝国备份王后,配置数据库信息.选择-www.taomoban.net目录.还原数据库. 3.修改FTP目录下的config/config.php 数据库连接信息. 4.登陆网站后台-
0
记录下来供以后配置时参考。
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号