ssm的applicationContext-mybatis.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:aop="http://www.springframework.org/schema/aop"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<!-- Properties文件读取配置,base的properties -->
<context:property-placeholder location="classpath:jdbc.properties" />
<!-- data source -->
<bean id="dataSource"
class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass" value="${datasource.driverClassName}"></property>
<property name="jdbcUrl" value="${datasource.url}"></property>
<property name="user" value="${datasource.username}"></property>
<property name="password" value="${datasource.password}"></property>
<!--当连接池中的连接耗尽的时候c3p0一次同时获取的连接数。Default: 3 -->
<property name="acquireIncrement" value="${c3p0.acquireIncrement}"></property>
<!--初始化时获取三个连接,取值应在minPoolSize与maxPoolSize之间。Default: 3 -->
<property name="initialPoolSize" value="${c3p0.initialPoolSize}"></property>
<property name="minPoolSize" value="${c3p0.minPoolSize}"></property>
<property name="maxPoolSize" value="${c3p0.maxPoolSize}"></property>
<!--最大空闲时间,60秒内未使用则连接被丢弃。若为0则永不丢弃。Default: 0 -->
<property name="maxIdleTime" value="${c3p0.maxIdleTime}"></property>
<!--每60秒检查所有连接池中的空闲连接。Default: 0 -->
<property name="idleConnectionTestPeriod" value="${c3p0.idleConnectionTestPeriod}"></property>
<!-- JDBC的标准参数,用以控制数据源内加载的PreparedStatements数量。但由于预缓存的statements
属于单个connection而不是整个连接池。所以设置这个参数需要考虑到多方面的因素。
如果maxStatements与maxStatementsPerConnection均为0,则缓存被关闭。Default: 0-->
<property name="maxStatements" value="${c3p0.maxStatements}"></property>
<!-- c3p0是异步操作的,缓慢的JDBC操作通过帮助进程完成。扩展这些操作可以有效的提升性能 通过
多线程实现多个操作同时被执行。Default: 3-->
<property name="numHelperThreads" value="${c3p0.numHelperThreads}"></property>
</bean>
<!-- 定义 SqlSessionFactory -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"
scope="singleton">
<property name="dataSource" ref="dataSource" />
<property name="configLocation" value="classpath:mybatis-config.xml" />
</bean>
<!-- (事务管理)transaction manager, use JtaTransactionManager for global tx -->
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<!-- 配置事务通知属性 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<!-- 定义事务传播属性 -->
<tx:attributes>
<tx:method name="insert*" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
<tx:method name="edit*" propagation="REQUIRED" />
<tx:method name="save*" propagation="REQUIRED" />
<tx:method name="add*" propagation="REQUIRED" />
<tx:method name="new*" propagation="REQUIRED" />
<tx:method name="set*" propagation="REQUIRED" />
<tx:method name="remove*" propagation="REQUIRED" />
<tx:method name="delete*" propagation="REQUIRED" />
<tx:method name="change*" propagation="REQUIRED" />
<tx:method name="get*" propagation="REQUIRED" read-only="true" />
<tx:method name="select*" propagation="REQUIRED" read-only="true" />
<tx:method name="query*" propagation="REQUIRED" read-only="true" />
<tx:method name="find*" propagation="REQUIRED" read-only="true" />
<tx:method name="load*" propagation="REQUIRED" read-only="true" />
<tx:method name="*" propagation="REQUIRED" read-only="true" />
</tx:attributes>
</tx:advice>
分享到:
相关推荐
ssm框架基础配置文件,不需要自己每次都手动敲,拿来即用,注意修改少数几个路径,超级方便。
ssm框架配置简要说明,一些必要的文档说明, 懂SSM框架基础的适合观看一下
ssm框架脚手架java基础配置文件Spring/SpringMVC/MyBatis eclipse下。ssm框架脚手架java基础配置文件Spring/SpringMVC/MyBatis eclipse下。ssm框架脚手架java基础配置文件Spring/SpringMVC/MyBatis eclipse下。...
Java开发项目基于SSM框架的管理系统源代码。基于SSM框架的管理系统 实现 登录 、 注册 、 增 、 删 、 改 、 查 ; 可继续完善增加前端、校验、其他功能等; 可作为SSM项目开发练习基础模型; 课程设计 、 毕业...
适合使用SSM框架开发的人群,可以在此基础上进行添加功能等,将SSM配置都已经弄好。
SSM-xml+注解整合SSM框架-《员工信息管理系统》-功能演示.mp4 ...主要利用xml配置问价+注解整合SSM框架,在此基础上实现一套crud。 前端没有使用模板,所以大道至简,主要是联系ssm框架的整合方法。
spring+spring mvc +mybatis 整合maven工程
ssm框架的基本模型,包括一些配置文件,还有接口、实现类,并且都有详细的注释
适合初学者,SSM框架基础的搭建和最简单的配置文件,没有工具包跟拦截器,只是单纯的框架。
ssm项目基础框架搭建,包括maven配置、spring、springMvc、mybatis、logging等基础内容、xml配置注释详细
基础的ssm框架整合配置,实现简单的crud功能,对新手有帮助
1711A 六组项目简介(仓库管理系统) 我们做的是一个仓库管理系统,它包含:菜单管理、基础...配置:项目用的是maven+ssm框架+httpclient+webservice+mongodb+redis缓存技术,需要配置相应的配置文件,才可以运行此文件
使用此资源的好处:我们都知道搭建SSM项目最麻烦的就是前期进行框架的搭建,配置很麻烦很繁琐,人称配置地狱,这个模板可以为你省去大量的搭建时间,不过这其中的内容是一个很基础的项目,没有大量的功能,只有简单...
按部就班地学习:建议从基础的Java Web开发开始,逐步深入到SSM框架的学习。通过实践,逐步掌握SSM框架的使用技巧和Java Web开发的最佳实践。 参考项目文件和笔记:项目文件和笔记提供了丰富的背景信息和开发经验。...
项目标题:基于SSM框架的Java CRUD操作演示源码 ...本项目以简洁明了的代码展示了SSM框架在实现后端CRUD操作的基础应用,适合作为学习SSM框架的经典入门示例,也便于开发者在此基础上进行扩展和优化。
适合对SSM没有使用过的同学,讲解通俗易懂,覆盖了当前SSM使用的基本操作 课程内容: 1、Spring简介及快速入门 2、Spring配置文件及其相应API 3、Spring注解开发 4、Spring web环境及其Junit的集成 5、Spring ...
- Properties配置文件:4个,包含系统的基础配置信息。 - JPG图片:3个,用于界面美化和视觉辅助。 简而言之,这是一个基于SSM框架开发的宿舍管理系统,不仅界面友好、操作便捷,而且能够高效地处理宿舍相关的各项...
webservice里面的框架技术 cxf生成一个沟通接口的桥梁,然后新建一个沟通桥梁的类,再通过配置相关的配置文件及jar包就可以调用出接口中的数据,之后选中一条数据,并输入收件人的邮箱 ,点击发送后,我们会将收件人...
一、项目简介 ...基础数据管理:客户资料管理,系统基础数据配置,维修项目管理,供应商管理,配件信息管理,仓库信息管理,业务类型管理等 https://blog.csdn.net/weixin_43860634/article/details/125337823
按部就班地学习:建议从基础的Java Web开发开始,逐步深入到SSM框架的学习。通过实践,逐步掌握SSM框架的使用技巧和Java Web开发的最佳实践。 参考项目文件和笔记:项目文件和笔记提供了丰富的背景信息和开发经验。...