SSM项目的spring-mybatis.xml
来源:互联网 发布:用友加密狗提取数据 编辑:程序博客网 时间:2024/06/05 21:49
<?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" 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-4.0.xsd"> <!-- 自动扫描(扫描的什么,有什么作用,为什么需要扫描???) --> <context:component-scan base-package="com.iot.modul" /> <!-- 引入配置文件 --> <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <!-- 这里的classpath是谁在哪里定义的??? --> <property name="location" value="classpath:jdbc.properties" /> </bean> <!-- 如何与jdbc.properties联系上的??? --> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="${driver}" /> <property name="url" value="${url}" /> <property name="username" value="${username}" /> <property name="password" value="${password}" /> <!-- 初始化连接大小 --> <property name="initialSize" value="${initialSize}"></property> <!-- 连接池最大数量 --> <property name="maxActive" value="${maxActive}"></property> <!-- 连接池最大空闲 --> <property name="maxIdle" value="${maxIdle}"></property> <!-- 连接池最小空闲 --> <property name="minIdle" value="${minIdle}"></property> <!-- 获取连接最大等待时间 --> <property name="maxWait" value="${maxWait}"></property> </bean> <!-- spring和MyBatis完美整合,不需要mybatis的配置映射文件 --> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <!-- 自动扫描mapping.xml文件 --> <property name="mapperLocations" value="classpath:com/iot/modul/mapping/*.xml"></property> </bean> <!-- DAO接口所在包名,Spring会自动查找其下的类 --> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="basePackage" value="com.iot.modul.dao" /> <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"></property> </bean> <!-- (事务管理)transaction manager, use JtaTransactionManager for global tx --> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource" /> </bean> </beans>
阅读全文
0 0
- SSM项目的spring-mybatis.xml
- SSM项目的spring-mvc.xml配置
- ssm(spring+springmvc+mybatis)xml版的整合
- SSM整合中spring-mybatis.xml详解
- SSM(Spring+SpringMVC+Mybatis)+Maven项目搭建
- Spring+Spring Mvc+Mybatis+MySqlite(SSM框架整合Xml配置)
- 【SSM-MyBatis框架】SqlMapConfig.xml的配置
- 【SSM-MyBatis框架】SqlMapConfig.xml的配置
- idea+maven+ssm(spring+spring mvc+mybatis)初始化项目
- 解决idea创建ssm项目找不到mybatis的mapper的xml文件问题
- ssm项目打包后mybatis的mapper.xml文件没有放进去
- SSM项目从零开始到入门011-详解mybatis的XML 映射配置文件
- Spring,SpringMVC,Mybatis (SSM)框架的搭建
- SSM Spring +SpringMVC+Mybatis 配置 及pom.xml
- ssm spring+springmvc+mybatis中的xml配置文件详解
- SSM框架(spring+springMVC+Mybatis) pom.xml文件
- SSM框架(spring+springMVC+Mybatis) pom.xml文件
- SSM:spring+springmvc+mybatis框架中的XML配置文件功能
- Java垃圾回收机制与典型的垃圾回收算法
- QRCode二维码字符长度问题
- Unity修改C#默认创建Script 脚本格式
- TypeError: Cannot create a consistent method resolution
- log4j详解与实战
- SSM项目的spring-mybatis.xml
- 2017年最炫酷的30个安卓库
- 【转】CMSIS标准 (Cortex Microcontroller Software Interface Standard)
- String与StringBuilder区别
- WebView内存泄漏修复
- FIR滤波器的实现
- Effective Java之创建和销毁对象
- Geary 0.12:linux的邮件应用的福音
- SIM卡引脚定义