【一】简易的数据源配置
(1)配置文件
<!--springJdbcTemplemate数据操作配置信息 --> <bean id="driver" class="com.mysql.jdbc.Driver"></bean> <bean id="dataSource" class="org.springframework.jdbc.datasource.SimpleDriverDataSource"> <property name="url"><value>jdbc:mysql://localhost:3306/mobile_thinks</value></property> <property name="username"><value>root</value></property> <property name="password"><value>shangxiaofei</value></property> <property name="driver" ref="driver"/> </bean> <bean id="JdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate"> <property name="dataSource" ref="dataSource"/> </bean>