日期:2014-05-16 浏览次数:20832 次
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName"> <value>com.mysql.jdbc.Driver</value> </property> <property name="url"> <value>jdbc:mysql://localhost:3306/test</value> </property> <property name="username"> <value>username</value> </property> <property name="password"> <value>password</value> </property> </bean>
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass"> <value>com.mysql.jdbc.Driver</value> </property> <property name="jdbcUrl"> <value>jdbc:mysql://localhost:3306/test</value> </property> <property name="properties"> <props> <prop key="c3p0.minPoolSize">2</prop> <prop key="c3p0.maxPoolSize">50</prop> <prop key="c3p0.timeout">5000</prop> <prop key="c3p0.max_statement">100</prop> <prop key="c3p0.testConnectionOnCheckout">true</prop> <prop key="user">root</prop> <prop key="password">123456</prop> </props> </property> </bean>