<!-- 注册数据源:Spring内置连接池 -->
<!-- <bean id="myDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
  <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
  <property name="url" value="jdbc:mysql://127.0.0.1:3306/test"/>
  <property name="username" value="root"/>
  <property name="password" value="123456"/>
</bean> -->
<!-- <bean id="myDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
  <property name="driverClassName" value="${jdbc.driver}"/>
  <property name="url" value="${jdbc.url}"/>
  <property name="username" value="${jdbc.user}"/>
  <property name="password" value="${jdbc.password}"/>
</bean> -->

<!-- 注册数据源:DBCP-->
<!--
<bean id="myDataSource" class="org.apache.tomcat.dbcp.dbcp.BasicDataSource">
  <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
  <property name="url" value="jdbc:mysql://127.0.0.1:3306/test"/>
  <property name="username" value="root"/>
  <property name="password" value="123456"/>
</bean> -->

<!-- 注册数据源:C3P0-->
<!-- <bean id="myDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"> -->
  <bean id="myDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
    <property name="driverClass" value="com.mysql.jdbc.Driver"/>
    <property name="jdbcUrl" value="jdbc:mysql://127.0.0.1:3306/test"/>
    <property name="user" value="root"/>
    <property name="password" value="123456"/>
  </bean>

<!-- 注册数据源:C3P0-->
<!-- <bean id="myDataSource" class="org.mchange.v2.c3p0.ComboPooledDataSource">
  <property name="driverClass" value="${jdbc.driver}"/>
  <property name="jdbcUrl" value="${jdbc.url}"/>
  <property name="user" value="${jdbc.user}"/>
  <property name="password" value="${jdbc.password}"/>
</bean> -->

<!-- 注册属性文件:方式一 -->
<!--
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  <property name="location" value="classpath:jdbc.properties"/>
</bean> -->

<!-- 注册属性文件:方式二 -->
<context:property-placeholder location="classpath:jdbc.properties"/>

<!-- 注册JdbcTemplate -->
<!--
  <bean id="myJdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
    <property name="dataSource" ref="myDataSource"/>
  </bean>
-->