zoukankan      html  css  js  c++  java
  • applicationContext

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd ">

    <!-- 指定spring读取db.properties配置 -->
    <context:property-placeholder location="classpath:db.properties" />

    <!-- 1.将连接池放入spring容器 -->
    <bean name="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" >
    <property name="jdbcUrl" value="${jdbc.jdbcUrl}" ></property>
    <property name="driverClass" value="${jdbc.driverClass}" ></property>
    <property name="user" value="${jdbc.user}" ></property>
    <property name="password" value="${jdbc.password}" ></property>
    </bean>


    <!-- 2.将JDBCTemplate放入spring容器 -->
    <bean name="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate" >
    <property name="dataSource" ref="dataSource" ></property>
    </bean>

    <!-- 3.将UserDao放入spring容器 -->
    <bean name="userDao" class="cn.lijun.dao.UserDaoIml" >
    <!-- <property name="jt" ref="jdbcTemplate" ></property> -->
    <property name="dataSource" ref="dataSource" ></property>
    </bean>

    </beans>

  • 相关阅读:
    linux mysql开启远程链接
    Nginx 下无法读取session 导致 thinkphp验证码错误
    Nginx 开启 path_info功能
    让chrome打开手机网页
    vue 组件和全局组件的注册、使用
    Vue 导入文件import、路径@和.的区别
    vue 打包路径不对设置方法
    id
    Ajax GET 和 POST 的区别
    前端笔试题汇总 2018/12/04 (2)
  • 原文地址:https://www.cnblogs.com/lijun6/p/10568242.html
Copyright © 2011-2022 走看看