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>

  • 相关阅读:
    【webrtc】PTCPeerConnection(28)
    windows传文件到linux服务器--- secureCRT PK xftp
    Navicat premium查看数据库表中文注释的两种方式
    Jmeter 5.1实现图片上传接口测试
    查看服务器内存、CPU、网络等占用情况的命令--汇总
    AWS服务器上安全组端口设置和访问的问题
    linux服务器时间乱码问题解决
    连接linux的几款工具 简介
    服务器上build.xml文件乱码解决(亲测有效)
    jmeter通过ant执行时报错 jmeter.log not found
  • 原文地址:https://www.cnblogs.com/luchangguang/p/6684779.html
Copyright © 2011-2022 走看看