日期:2014-05-16 浏览次数:20520 次
jdbc.properties # Properties file with JDBC and JPA settings. # # Applied by <context:property-placeholder location="jdbc.properties"/> from # various application context XML files (e.g., "applicationContext-*.xml"). # Targeted at system administrators, to avoid touching the context XML files. #------------------------------------------------------------------------------- # MySQL Settings #加载驱动 jdbc.driverClassName=com.mysql.jdbc.Driver #指定数据库、设置字符集、编码格式、自动连接 jdbc.url=jdbc:mysql://localhost:8080/?useUnicode=true&characterEncoding=UTF8&characterSetResults=UTF8&autoReconnect=true #数据库名字 jdbc.username=root #数据库密码 jdbc.password=123456 #mysqlmysql\u8FDE\u63A5\u5173\u95ED c3p0\u672A\u5173\u95ED\u95EE\u9898 c3p0.minPoolSize = 1 c3p0.maxPoolSize = 50 c3p0.initialPoolSize = 1 c3p0.maxIdleTime = 25000 c3p0.acquireIncrement = 1 c3p0.acquireRetryAttempts = 30 c3p0.acquireRetryDelay = 1000 c3p0.testConnectionOnCheckin = false #c3p0.automaticTestTable = t_c3p0 c3p0.idleConnectionTestPeriod = 18000 c3p0.checkoutTimeout=5000 # Properties that control the population of schema and data for a new data source #jdbc.initLocation=classpath:db/mysql/initDB.txt #jdbc.dataLocation=classpath:db/mysql/populateDB.txt # Property that determines which Hibernate dialect to use # (only applied with "applicationContext-hibernate.xml") #hibernate.dialect=org.hibernate.dialect.MySQLDialect # Property that determines which JPA DatabasePlatform to use with TopLink Essentials #jpa.databasePlatform=oracle.toplink.essentials.platform.database.MySQL4Platform # Property that determines which database to use with an AbstractJpaVendorAdapter
<?xml version="1.0" encoding="UTF-8"?> <!-- - DispatcherServlet application context for PetClinic's web tier. --> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xmlns:oxm="http://www.springframework.org/schema/oxm" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/oxm http://www.springframework.org/schema/oxm/spring-oxm-3.2.xsd"> <!-- c3p0 的数据库连接池 --> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass" value="${jdbc.driverClassName}" /> <property name="jdbcUrl" value="${jdbc.url}" /> <property name="user" value="${jdbc.username}" /> <property name="password" value="${jdbc.password}" /> <property name="minPoolSize" value="${c3p0.minPoolSize}"/> <property name="maxPoolSize" value="${c3p0.maxPoolSize}"/> <property name="initialPoolSize" value="${c3p0.initialPoolSize}"/> <property name="maxIdleTime" value="${c3p0.maxIdleTime}"/> <property name="acquireIncrement" value="${c3p0.acquireIncrement}"/> <property name="acquireRetryAttempts" value="${c3p0.acquireRetryAttempts}"/> <property name="acquireRetryDelay" value="${c3p0.acquireRetryDelay}"/> <property name="testConnectionOnCheckin" value="${c3p0.testConnectionOnCheckin}"/> <!-- <property name="automaticTestTable" value="${c3p0.automaticTestTable}"/>