zoukankan      html  css  js  c++  java
  • applicationContext.xml

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

    <!-- 扫描注解类 -->
    <context:component-scan base-package="cn.bdqn.oa.service"></context:component-scan>

    <!-- 数据源 -->
    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
    <property name="url" value="jdbc:oracle:thin:@localhost:1521:orcl"></property>
    <property name="username" value="user_a"></property>
    <property name="password" value="abc123"></property>
    <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"></property>
    </bean>

    <!-- 事务管理器 -->
    <bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
    <property name="dataSource" ref="dataSource"></property>
    </bean>

    <tx:annotation-driven transaction-manager="txManager"/>


    <!-- sqlsessionFactory -->
    <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
    <property name="dataSource" ref="dataSource"></property>
    <property name="typeAliasesPackage" value="cn.bdqn.oa.entity"/>
    </bean>

    <!-- 扫描所有的mybatis接口成对象 -->
    <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
    <property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
    <property name="basePackage" value="cn.bdqn.oa.mapper"></property>
    </bean>


    </beans>

  • 相关阅读:
    C#简单读取MongoDB数据
    百度地图自定义图标
    递归实现DropDownList层级
    [MYSQL]-EXPLAIN用法
    java对 zip文件的压缩和解压(ant解决中文乱码)
    将Excel表结构导入到Powerdesigner
    weblogic解决jar包冲突
    深入理解javascript原型和闭包(3)——prototype原型
    深入理解javascript原型和闭包(2)——函数和对象的关系
    深入理解JavaScript的原型和闭包(一)
  • 原文地址:https://www.cnblogs.com/luchangguang/p/6684779.html
Copyright © 2011-2022 走看看