mybatis-config.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: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配置的更多相关文章
- Mybatis config.xml 配置
<!-- xml标准格式 --><?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE ...
- generator自动生成mybatis的xml配置
generator自动生成mybatis的xml配置.model.map等信息:1.下载mybatis-generator-core-1.3.2.jar包. 网址:http://code. ...
- SpringBoot系列-整合Mybatis(XML配置方式)
目录 一.什么是 MyBatis? 二.整合方式 三.实战 四.测试 本文介绍下SpringBoot整合Mybatis(XML配置方式)的过程. 一.什么是 MyBatis? MyBatis 是一款优 ...
- 06 Mybatis 使用xml配置映射模式+动态SQL---使用案例
1.项目结构 2.数据库表User对应的实体类 package domain; import java.io.Serializable; import java.util.Date; /** * 数据 ...
- Mybatis的xml配置(mybatis-config.xml)精简笔记
老规矩,看着官方文档学 首先,我们需要知道的是,在MyBatis 的xml配置文件中,这些影响 MyBatis 行为的属性之间的设置是有先后顺序的.配置的先后顺序依照properties, setti ...
- MyBatis—mybatis-config.xml配置介绍
在定义sqlSessionFactory时需要指定MyBatis主配置文件: Xml代码 说明: 收藏代码 1. <bean id="sqlSessionFactory" ...
- SpringBoot 整合 Mybatis + Mysql——XML配置方式
一.介绍 SpringBoot有两种方法与数据库建立连接,一种是集成Mybatis,另一种用JdbcTemplate,本文主要讨论集成Mybatis方式. SpringBoot整合Mybatis也有两 ...
- MyBatis之xml配置配置文件(一)(xml配置文件)
一.properties标签 <properties resource="jdbc.properties"></properties> 使用properti ...
- SpringBoot整合MyBatis之xml配置
现在业界比较流行的数据操作层框架 MyBatis,下面就讲解下 Springboot 如何整合 MyBatis,这里使用的是xml配置SQL而不是用注解.主要是 SQL 和业务代码应该隔离,方便和 D ...
- Mybatis基于XML配置SQL映射器(二)
Mybatis之XML注解 之前已经讲到通过 mybatis-generator 生成mapper映射接口和相关的映射配置文件: 下面我们将详细的讲解具体内容 首先我们新建映射接口文档 sysUse ...
随机推荐
- No supported encrypter found. The cipher and / or key length are invalid.
终端使用如下命令: php artisan key:generate 将生成的key复制到config/app.php替换82行的APP_KEY键值.
- js学习笔记21----表格操作
1.获取表格元素: tHead : 表格头 tBody : 表格主体内容 tFoot : 表格尾 rows : 表格行 cells : 表格列 如获取表格第一行第一列的数据: <script ...
- C++:在堆上创建对象,还是在栈上?
这篇文章来自于一次讨论:http://www.devbean.net/2013/01/qt-study-road-2-model-view/#comment-17532.关于究竟是在堆上还是在栈上创建 ...
- 关于Unity中UI中的Mask组件、Text组件和布局
一.Mask组件 遮罩,Rect Mask矩形Mask(Rect Mask2D组件),图片Mask(Mask组件)(图片Mask的透明度不为0的部分显示子图片,为0的部分不显示子图片) Rect Ma ...
- selenium测试(Java)--上传文件(十五)
1. 当页面中是通过input标签实现上传功能时,可以使用selenium来上传功能. 如下: package com.test.upload; import java.io.File; import ...
- 【Java NIO的深入研究5】字符集Charset
Java 语言被定义为基于Unicode.一个字符实体由二个字节表示(如果是用UCS-2).但众多文件和数据流都是基于其它字符编码并以byte传输,操作文件内容就成了一个问题. 操作一个文件首先要对文 ...
- u3d调用自己的dll
原文地址:http://blog.sina.com.cn/s/blog_62f7cb730100zhhf.html 首先用vc建立一个dll工程 然后在里面建立一个testunity.h文件.内容如下 ...
- SRCNN之后的深度学习超分辨率
SRCNN开山之作 IDN 信息蒸馏网络information distillation network(IDN) Fast and Accurate Single Image Super-Resol ...
- DEDECMS教程:首页实现分页的两种方法
有两种办法可以实现: 一.用arclist标签+Ajax实现织梦首页分页 二.交叉栏目ID 实现织梦首页分页 一.用arclist标签+Ajax实现织梦首页分页 1.必须在首页<head> ...
- Linux中的SELinux详解--16
SELinux 宽容模式(permissive) 强制模式(enforcing) 关闭(disabled) 几种模式之间的转换 在CentOS6.2 中安装intel 的c++和fortran 的编 ...