<?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:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd">

<!-- Activates annotation-based bean configuration -->
<context:annotation-config />

<!-- 导入属性配置文件 -->
<!--
<context:property-placeholder location="classpath:orcl.properties" order="1" />
-->
<!-- 配置数据源 -->
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"
init-method="init" destroy-method="close">
<property name="driverClassName" value="${ora.jdbc.driverClassName}" />
<property name="url" value="${ora.jdbc.url}" />
<property name="username" value="${ora.jdbc.username}" />
<property name="password" value="${ora.jdbc.password}" />
<property name="minIdle" value="${ora.jdbc.minIdle}" /> <!-- 队列中的最小等待数 -->
<!-- <property name="maxIdle" value="${ora.jdbc.maxIdle}" /> 队列中的最大等待数 -->
<property name="maxWait" value="${ora.jdbc.maxWait}" /> <!-- 最长等待时间,单位毫秒 -->
<property name="maxActive" value="${ora.jdbc.maxActive}" /> <!-- 最大活跃数 -->
<property name="initialSize" value="${ora.jdbc.initialSize}" /><!-- 初始大小 -->
<property name="filters" value="stat" /><!-- 配置监控统计拦截的filters,去掉后监控界面sql无法统计 -->

<property name="validationQuery" value="${ora.jdbc.validationQuery}" />
<property name="testWhileIdle" value="true" />
<property name="testOnBorrow" value="false" />
<property name="testOnReturn" value="false" />

</bean>

<!-- 使用JDBC事物 -->
<bean id="oraTxManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>

<!-- 使用annotation定义事务 -->
<tx:annotation-driven transaction-manager="oraTxManager"
proxy-target-class="true" />

<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="configLocation" value="classpath:sqlMapConfig.xml" />
<property name="dataSource" ref="dataSource" />

<property name="mapperLocations" value="classpath:com/syy/sys/**/domain/*Mapper.xml"></property>
<property name="plugins">
<!-- <list> -->
<!-- <bean -->
<!-- class="com.github.miemiedev.mybatis.paginator.OffsetLimitInterceptor"> -->
<!-- <property name="dialectClass" -->
<!-- value="com.github.miemiedev.mybatis.paginator.dialect.SQLServer2005Dialect"></property> -->
<!-- </bean> -->
<!-- </list> -->
<array>
<bean class="com.github.pagehelper.PageHelper" />
</array>
</property>

</bean>

<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<!--
<property name="annotationClass" value="org.springframework.stereotype.Repository" />
-->
<property name="basePackage" value="com.syy.sys.domain.mapper" />
<!--
<property name="sqlSessionFactory" ref="sqlSessionFactory" />
-->

</bean>

</beans>

mybatis-config.xml配置的更多相关文章

  1. Mybatis config.xml 配置

    <!-- xml标准格式 --><?xml version="1.0" encoding="UTF-8"?>  <!DOCTYPE ...

  2. generator自动生成mybatis的xml配置

    generator自动生成mybatis的xml配置.model.map等信息:1.下载mybatis-generator-core-1.3.2.jar包.       网址:http://code. ...

  3. SpringBoot系列-整合Mybatis(XML配置方式)

    目录 一.什么是 MyBatis? 二.整合方式 三.实战 四.测试 本文介绍下SpringBoot整合Mybatis(XML配置方式)的过程. 一.什么是 MyBatis? MyBatis 是一款优 ...

  4. 06 Mybatis 使用xml配置映射模式+动态SQL---使用案例

    1.项目结构 2.数据库表User对应的实体类 package domain; import java.io.Serializable; import java.util.Date; /** * 数据 ...

  5. Mybatis的xml配置(mybatis-config.xml)精简笔记

    老规矩,看着官方文档学 首先,我们需要知道的是,在MyBatis 的xml配置文件中,这些影响 MyBatis 行为的属性之间的设置是有先后顺序的.配置的先后顺序依照properties, setti ...

  6. MyBatis—mybatis-config.xml配置介绍

    在定义sqlSessionFactory时需要指定MyBatis主配置文件: Xml代码   说明: 收藏代码 1.  <bean id="sqlSessionFactory" ...

  7. SpringBoot 整合 Mybatis + Mysql——XML配置方式

    一.介绍 SpringBoot有两种方法与数据库建立连接,一种是集成Mybatis,另一种用JdbcTemplate,本文主要讨论集成Mybatis方式. SpringBoot整合Mybatis也有两 ...

  8. MyBatis之xml配置配置文件(一)(xml配置文件)

    一.properties标签 <properties resource="jdbc.properties"></properties> 使用properti ...

  9. SpringBoot整合MyBatis之xml配置

    现在业界比较流行的数据操作层框架 MyBatis,下面就讲解下 Springboot 如何整合 MyBatis,这里使用的是xml配置SQL而不是用注解.主要是 SQL 和业务代码应该隔离,方便和 D ...

  10. Mybatis基于XML配置SQL映射器(二)

    Mybatis之XML注解 之前已经讲到通过 mybatis-generator 生成mapper映射接口和相关的映射配置文件: 下面我们将详细的讲解具体内容 首先我们新建映射接口文档  sysUse ...

随机推荐

  1. Spring下获取项目根路径--good

    Spring 在 org.springframework.web.util 包中提供了几个特殊用途的 Servlet 监听器,正确地使用它们可以完成一些特定需求的功能.比如某些第三方工具支持通过 ${ ...

  2. 利用jQuery进行三行两列等高布局

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  3. TensorFlow基础笔记(9) Tensorboard可视化显示以及查看pb meta模型文件的方法

    参考: http://blog.csdn.net/l18930738887/article/details/55000008 http://www.jianshu.com/p/19bb60b52dad ...

  4. e641. 使一个组件成为拖放目标

    public class DropTargetComponent extends JComponent implements DropTargetListener { public DropTarge ...

  5. linux -- #!/bin/bash

    #!/bin/bash是指此脚本使用/bin/bash来解释执行. 其中,#!是一个特殊的表示符,其后,跟着解释此脚本的shell路径. bash只是shell的一种,还有很多其它shell,如:sh ...

  6. jquery -- onchange

    触发onchange 首先页面有一个input标签,并且已绑定onchange事件,如: 1 <input type="text" onchange="consol ...

  7. Windows 上 GitHub Desktop 的操作[转]

    第1章 上传开源代码至GitHub    1 1.1 git Windows 客户端    1 1.2 注册GitHub账户    2 1.3 登录    2 1.4 创建本地代码仓库    2 1. ...

  8. mybatis由浅入深day02_2一对一查询_2.3方法二:resultMap_resultType和resultMap实现一对一查询小结

    2.3 方法二:resultMap 使用resultMap,定义专门的resultMap用于映射一对一查询结果. 2.3.1 sql语句 同resultType实现的sql SELECT orders ...

  9. Java精选笔记_其他IO流(ObjectInputStream、DataInputStream、PrintStream、标准输入输出流)

    其他IO流 ObjectInputStream和ObjectOutputStream 如果希望永久将对象转为字节数据写入到硬盘上,即对象序列化,可以使用ObjectOutputStream(对象输出流 ...

  10. POJ 3093 Margaritas(Kind of wine) on the River Walk (背包方案统计)

    题目 Description One of the more popular activities in San Antonio is to enjoy margaritas in the park ...