Spring使用C3P0,从db.properties文件中读取信息,连接数据库
来源:互联网 发布:淘宝运营wlpeixun 编辑:程序博客网 时间:2024/06/03 17:29
<span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px;">spring配置信息</span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px;"><?xml version="1.0" encoding="UTF-8"?></span>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"xmlns:context="http://www.springframework.org/schema/context"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"><context:property-placeholder location="classpath:db.properties" /><bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"><property name="user" value="${jdbc.user}"></property><property name="password" value="${jdbc.password}"></property><property name="driverClass" value="${jdbc.driverClass}"></property><property name="jdbcUrl" value="${jdbc.jdbcUrl}"></property><property name="initialPoolSize" value="${jdbc.initPoolSize}"></property><property name="maxPoolSize" value="${jdbc.maxPoolSize}"></property></bean></beans>
db.properties文件信息
jdbc.user=rootjdbc.password=rootjdbc.driverClass=com.mysql.jdbc.Driverjdbc.jdbcUrl=jdbc:mysql://localhost:3306/springjdbc.initPoolSize=5jdbc.maxPoolSize=10
0 0
- Spring使用C3P0,从db.properties文件中读取信息,连接数据库
- 从.properties文件中读取信息
- jsp中从db.properties文件中读取数据
- spring读取properties文件信息
- java IO 使用Properties设置键值对配置信息 写入文件和从文件中读取
- 读取properties文件连接数据库
- j2ee 使用db.properties连接mysql数据库
- 从config文件中读取数据库信息
- Spring中使用Jdbcdaosupport、C3P0和properties
- Spring注入自定义的从数据库中读取的Properties
- 使用spring读取properties文件
- 如何使用c3p0+spring连接oracle数据库
- Spring中属性文件properties的读取与使用
- Spring中属性文件properties的读取与使用
- Spring中属性文件properties的读取与使用
- Spring中属性文件properties的读取与使用
- Spring中属性文件properties的读取与使用
- Spring中属性文件properties的读取与使用
- C++一些特性第一节
- leetcode——Merge Intervals
- SDUT 3335 数据结构实验之栈八:栈的基本操作
- HTML
- android5.0之animated-selector
- Spring使用C3P0,从db.properties文件中读取信息,连接数据库
- 横向ListView(HorizontalListView)之滑动到指定Item
- ListView万能适配器(半成品)
- 关于NSURLSession
- 给 Android 开发者的 RxJava 详解
- jsp基础
- Spring IOC容器基本原理
- AJAX基础和jQuery中的AJAX
- 水平触发和边缘触发的区别