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 ...
随机推荐
- 非常强大的jQuery万能浮动框插件
支持hover, click, focus以及无事件触发:支持多达12种位置的定位,出界自动调整:支持页面元素加载,Ajax加载,下拉列表,提示层效果,tip类效果等:可自定义装载容器:内置UI不错的 ...
- Python 变量类型和运算符
-*- coding:utf-8 -*- ''' if语法 if conditon: [tab键] command [tab键] command ... else: [tab键] command [t ...
- imx6 qt 24bpp RGB
imx6运行qt,在24bit的LVDS接口屏上显示时,显示效果与实际的不同.蓝色变成了黄色. 本来应该显示成蓝色: 实际上去显示成了黄色: 而其他绿色的图标并没有改变,只是蓝色和黄色互换了. 猜想应 ...
- java中Scanner的nextLine()和next()的区别
首先,next()一定要读取到有效字符后才可以结束输入,对输入有效字符之前遇到的空格键.Tab键或Enter键等结束符,next()方法会自动将其去掉,只有在输入有效字符之后,next()方法才将其后 ...
- yuv420格式分析
http://blog.csdn.net/liuhongxiangm/article/details/9135791 http://blog.csdn.net/bluesky_sunshine/art ...
- websocke前世今生
注:以下内容来自网上.本人经过加工整理. 1.问什么要用websocke? Browser已经支持http协议,为什么还要开发一种新的WebSocket协议呢?我们知道http协议是一种单向的网络协议 ...
- oracle hint inline materialize
当我们使用with的时候,oracle可能会把with里面的结果转换为暂时表.这是仅仅是可能,由于CBO会推断. inline是不转换成暂时表.materialize是强制转换成暂时表. 制造数据 d ...
- 【Java面试题】17 如何把一个逗号分隔的字符串转换为数组? 关于String类中split方法的使用,超级详细!!!
split 方法:将一个字符串分割为子字符串,然后将结果作为字符串数组返回. stringObj.split([separator],[limit])参数:stringObj 必选项.要被分解的 ...
- php将汉字转换为拼音和得到词语首字母(二)
<?php class Pinyin{ private $_outEncoding = "GB2312"; public function getPinyin($str,$p ...
- notepadd添加插件
markdown相关插件: https://www.cnblogs.com/tocy/p/npp-support-markdonw-extension.html