【一】简易的数据源配置

(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>
View Code

相关文章:

  • 2022-12-23
  • 2021-06-20
  • 2021-09-14
  • 2021-06-08
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-09
  • 2022-12-23
  • 2021-06-14
  • 2022-12-23
  • 2021-06-19
  • 2022-12-23
  • 2022-01-07
相关资源
相似解决方案