spring+ibatis事务处理配置

Spring+ibatis 保留ibatis事务的配置 SPRING与IBATIS整合采用保留IBATIS事务,可自己控制回滚! 立即下载

(1)applicationContext-resources.xml 配数据源:

<beans>

    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
        <property name="url" value="jdbc:oracle:thin:@192.168.0.1:1521:AGMSC"/>
        <property name="username" value="test"/>
        <property name="password" value="test"/>
        <property name="maxActive" value="100"/>
        <property name="maxIdle" value="30"/>
        <property name="maxWait" value="1000"/>
        <property name="defaultAutoCommit" value="true"/>
        <property name="removeAbandoned" value="true"/>
        <property name="removeAbandonedTimeout" value="60"/>
    </bean>
</beans>

(2)applicationContext-ibatis.xml  符合Ibatis的DAO配置:

<beans>
    <!-- Transaction manager for a single JDBC DataSource -->
    <bean id="transactionManager"
        class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource"/>
    </bean>
   
    <!-- SqlMap setup for iBATIS Database Layer -->
    <bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
        <property name="configLocation">
            <value>classpath:/com/aigomusic/dao/ibatis/sql-map-config.xml</value>
        </property>
        <property name="dataSource" ref="dataSource"/>
    </bean>

    <!-- Generic Dao - can be used when doing standard CRUD -->
    <bean id="dao" class="com.aigomusic.dao.ibatis.BaseDaoIbatis">
        <property name="dataSource" ref="dataSource"/>
        <property name="sqlMapClient" ref="sqlMapClient"/>
    </bean>
   
    <!-- ammRingtoneDao: iBatis implementation -->
    <bean id="ammRingtoneDao" class="com.aigomusic.dao.ibatis.AmmRingtoneDaoIbatis">
        <property name="dataSource" ref="dataSource"/>
        <property name="sqlMapClient" ref="sqlMapClient"/>
    </bean>
   
    <!-- ammImageDao: iBatis implementation -->
    <bean id="ammImageDao" class="com.aigomusic.dao.ibatis.AmmImageDaoIbatis">
        <property name="dataSource" ref="dataSource"/>
        <property name="sqlMapClient" ref="sqlMapClient"/>
    </bean>
</beans>

(3)AmmImageDaoIbatis.java  符合Ibatis的DAO实现代码:

public class AmmImageDaoIbatis extends BaseDaoIbatis implements AmmImageDao {
 /**
  * 测试成功
  */
 public AmmImage getAmmImage(String fringmodelid) {
  return (AmmImage) getSqlMapClientTemplate().queryForObject(
    "getAmmImage", fringmodelid);
 }

 /**
  * 测试成功
  */
 public AmmImagePage getAmmImages(AmmImagePage ammImagePage) {
  ammImagePage.handlePage(Integer
    .parseInt((String) getSqlMapClientTemplate().queryForObject(
      "getAmmImagesCount", ammImagePage)),
    ammImagePage.getPageNo(), ammImagePage.getPageSize());
  ammImagePage.setItemList(getSqlMapClientTemplate().queryForList(
    "getAmmImages", ammImagePage));
  return ammImagePage;
 }

 
 /**
  * 测试成功
  */ 
 public AmmImagePage getDownloadRate(AmmImagePage ammImagePage) {
  if(ammImagePage==null){ammImagePage=new AmmImagePage();}
  ammImagePage.handlePage(ammImagePage.getItemCount(),ammImagePage.getPageNo(), ammImagePage.getPageSize());
  ammImagePage.setItemList(getSqlMapClientTemplate().queryForList(
    "getAmmImages_ByDownloadRate", ammImagePage));
  return ammImagePage;
 }

 public AmmImagePage getComsumeRate() {
  AmmImagePage ammImagePage = new AmmImagePage();
  ammImagePage.setItemList(getSqlMapClientTemplate().queryForList(
    "getMobileNumbers_ByComsumeRate", null));
  return ammImagePage;
 }

}

(4)applicationContext-service.xml  业务接口配置文件

<beans>

 <!-- Generic manager that can be used to do basic CRUD operations on any objects -->
 <bean id="manager" class="com.aigomusic.service.impl.BaseManager">
  <property name="dao" ref="dao" />
 </bean>

 <bean id="ammRingtoneManager"
  class="com.aigomusic.service.impl.AmmRingtoneManagerImpl">
  <property name="ammRingtoneDao" ref="ammRingtoneDao" />
 </bean>

 <bean id="ammImageManager"
  class="com.aigomusic.service.impl.AmmImageManagerImpl">
  <property name="ammImageDao" ref="ammImageDao" />
 </bean>

 <!-- Add new Managers here -->
</beans>

(5)AmmImageManagerImpl.java  MANAGER实现代码:

public class AmmImageManagerImpl extends BaseManager implements
  AmmImageManager {
 private AmmImageDao ammImageDao;

 public void setAmmImageDao(AmmImageDao ammImageDao) {
  this.ammImageDao = ammImageDao;
 }

 public AmmImage getAmmImage(String fringmodelid) {
  return (AmmImage)ammImageDao.getAmmImage(fringmodelid);
 }

 public AmmImagePage getAmmImages(AmmImagePage ammImagePage) {
  return (AmmImagePage)ammImageDao.getAmmImages(ammImagePage);
 }

 public AmmImagePage getDownloadRate(AmmImagePage ammImagePage) {
  return (AmmImagePage)ammImageDao.getDownloadRate(ammImagePage);
 }

 public AmmImagePage getComsumeRate() {
  return (AmmImagePage)ammImageDao.getComsumeRate();
 }

}
 

spring ibatis 配置(包括事务管理) spring ibatis 配置spring ibatis 配置spring ibatis 配置spring ibatis 配置 立即下载

相关推荐

[Java]Ibatis Spring Integration Demo

动手写了一个Ibatis的Demo,反正啥东西,看着都是挺停简单的,Ibatis不就是一个ORM访问数据的东西嘛,不过在实际的动手的过程之中,还是需要到一些问题: 1)缺少这包,缺少那包的;还好用maven只要知道包的版本和2个ID,就不用自己到处找下载地址了。 2)使用的第三方框架太多,log4j输出太多,看起来费劲啊,另外一般异常日志也是一出就是一堆,不认真看,根本看不出问题在哪。在windows下用.net开发,早习惯了debugview去看(用好degbugview的过滤和高亮,可以让你第一眼就看到你想关注的信息);好几天一直在找一个类似的eclipse插件,不过还是无果而终。现在暂时自定义一个LogAppender去自己搞一个简单的过滤吧(这块有兴趣的可以去看org.ibatis.demo.core.log下代码)。 不知道为啥Spring这家伙为啥在java下有那么高的地位,感觉走到哪里都要用到它,不过无可否认java下Spring本身对于常见的框架都提供了很好的集成。很早以前.net和java程序员互相说自己好,对方不好的时候,看过过一句话:.net程序员里blog里都是大把的demo,java程序员blog经常是鸟文的摘抄或是翻译。感觉确实如此啊,java很少搜索到完整的demo,几乎都是断章取义的文字和代码。既然我是.net程序员现在再搞java,那么还延续.net程序员良好的习惯吧,上完整demo,也为一些需要的人,提供完整的参考。 Demo代码,没有啥太多的功能,就是对一张表的getAll(),然后输出结果的count值(.net下习惯了list.count,java是size,唉,老不习惯了,多写写java估计以后又习惯size,为啥人总是那么纠结呢?),数据库就不上了,大家要跑起来的话自己改改连库信息和实体代码以及xml的配置吧

spring+ibatis事务配置

<!-- 事务管理 --> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource"></prop...

weixin_30896825的博客 183

spring+ibatis事务的配置

很好的spring+ibatis事务的配置文档.

Springboot+ibatis 事务控制

guthub:https://github.com/liubin192837/spring/tree/master/springbootIbatisTransaction1.首先声明开启事务@SpringBootApplication @EnableTransactionManagement public class SpringbootibatisApplication { public ...

liubin192837的博客 1443

docker配置国内镜像源

【代码】docker配置国内镜像源。

愿听风成曲 9616

行政数据分析大屏实战:用Tableau从Excel到看板的完整搭建流程(含数据连接与字段计算避坑)

本文详细介绍了如何利用Tableau从Excel数据源搭建行政数据分析大屏的完整流程,涵盖数据准备、连接技巧、计算字段优化、看板设计及动态交互部署。通过五阶工作流,帮助用户高效处理多源异构数据,实现业务洞察与可视化呈现,提升行政数据分析效率。

weixin_29696711的博客 342

spring整合ibatis事务管理(各种AOP,比较乱)

Spring通过DAO模式,提供了对iBATIS的良好支持。SqlMapClient对象是iBATIS中的主要对象,我们可以通过配置让spring来管理SqlMapClient对象的创建。   与hibernate类似,Spring 提供了SqlMapClientDaoSupport对象,我们的DAO可以继承这个类,通过它所提供的SqlMapClientTemplate对象来操纵数据库

徐行 3896

深入探究贝叶斯网络(Bayesian Network):从基础原理到实际应用

贝叶斯网络,也称为信念网络或有向无环图模型,是一种概率图模型。它使用有向无环图(DAG)来表示随机变量之间的条件依赖关系。每个节点代表一个随机变量,边表示变量之间的条件依赖关系。贝叶斯网络作为一种强大的工具,通过结合概率论和图论,为复杂系统建模和推理提供了有效手段。无论是在医学诊断、故障检测还是自然语言处理等领域,它都展示了巨大的潜力。然而,其计算复杂度高、结构学习困难等挑战也需要我们在实际应用中不断优化算法和技术。希望通过本文,你能对贝叶斯网络有更深入的理解,并能够在实际项目中灵活应用这一强大工具。

qq_28791753的博客 5974

事务,为什么你不回滚

Java 提供了两类主要的异常 :runtime exception 和 checked exception 。 checked 异常也就是我们经常遇到的 IO 异常,以及 SQL 异常都是这种异常。 对于这种异常, JAVA 编译器强制要求我们必需对出现的这些异常进行 catch 。所以,面对这种异常不管我们是否愿意,只能自己去写一大堆 catch 块去处理可能的异常。     但是另外一种

我喂自己袋盐 2620

Windows/Mac/Linux三系统保姆级教程:用llama.cpp将safetensors模型转gguf格式(附常见错误解决)

本文提供Windows、Mac和Linux系统下使用llama.cpp将safetensors模型转换为gguf格式的详细教程,涵盖环境配置、转换原理及常见错误解决方案。通过跨平台兼容性处理,帮助开发者高效完成模型格式转换,优化边缘计算性能。

weixin_29227425的博客 270

用ESP32和HomeSpan自制HomeKit智能灯,手把手教你从零接入苹果家庭App

本文详细介绍了如何使用ESP32开发板和HomeSpan开源库自制原生HomeKit智能灯,从硬件搭建到软件配置,再到通过苹果家庭App控制的全过程。项目绕过了苹果MFi认证,成本低廉但功能完整,支持Siri语音控制、自动化场景等高级功能,是智能家居DIY的实用指南。

weixin_28717431的博客 323

Spring整个Ibatis之SqlMapClientDaoSupport

 Spring通过DAO模式,提供了对iBATIS的良好支持。SqlMapClient对象是iBATIS中的主要对象,我们可以通过配置让spring来管理SqlMapClient对象的创建,继而整合iBatis和Spring。 与hibernate类似,Spring 提供了SqlMapClientDaoSupport对象,我们的DAO可以继承这个类,通过它所提供的SqlMapClientT

miniyuyuhui的博客 521

32、社交媒体大数据中的情感分析与网络欺凌检测

本文探讨了社交媒体大数据在情感分析和网络欺凌检测中的应用。情感分析有助于应对自动化带来的社会变化、促进社会包容和推动环境保护。网络欺凌作为一种严重的在线危害,其检测依赖于数据预处理、特征提取与深度学习模型(如CNN、LSTM)进行分类。文章还总结了大数据在欺诈检测、医疗、制造、交通等领域的广泛应用,并分析了数据存储、处理速度、质量和技术工具等方面的挑战,提出了相应的应对策略。未来,随着技术进步,社交媒体大数据将在更多领域发挥关键作用。

cc789的博客 91

Spring+Ibatis完整配置文件

我提供一个实例: 数据库是MYSQL , 数据源是C3P0 , ----------- 1) 建表语句 : ---------------- DROP TABLE IF EXISTS book ; CREATE TABLE book( id int(11) NOT NULL auto_increment COMMENT 'primary key', n...

divi 172

基于情感分析+聚类分析+LDA主题分析对服装产品类的消费者评论分析

本研究旨在通过对服装产品类的消费者评论进行综合分析,为企业提供更全面、更深入的市场洞察和决策支持。同时,本研究的方法和结果也可以为其他领域的消费者评论分析提供借鉴和参考。

m0_64336780的博客 2万+

GEE生物量碳储量——利用sens和MK检验方法计算1987-2022年森林地上生物量AGB和碳储量的时空变化特征

本文是将之前已经处理好的森林生物量和碳储量数据保存到GEE Assets中,然后分别将单张影像导入到代码编辑器中,构建一个时间序列集合,并且这里需要用到的是我们给影像添加指定的时间属性,这样方便进行下一步的时序分析和空间预测。首先,需要收集1987年至2022年期间森林地上生物量AGB和碳储量数据。该数据可以通过森林清查数据、卫星遥感数据等途径获取。然后,根据这些数据,可以使用sens(敏感性分析)和MK(Mann-Kendall)方法计算时空变化特征。

此星光明博客 1264

IBATIS事务处理

iBATIS事务处理是和Dao紧密相联的。 在使用Dao时,如以下代码,先插入新记录,再进行更新: UserDao.insertUser (user); // Starts transaction user.setName("wh"); UserDao.updateUser (user); ...

weixin_30532987的博客 62

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

spring整合ibatis

 通过SqlMapClientTemplate来操纵数据库的CRUD是没有问题的,这里面关键的问题是事务处理。Spring提供了强大的声明式事务处理的功能,我们已经清楚hibernate中如何配置声明式的事务,那么在iBATIS中如何获得声明式事务的能力呢?   第一,我们需要了解的是spring通过AOP来拦截方法的调用,从而在这些方法上面添加声明式事务处理的能力。典型配置如下:appl...

wangzhantao的专栏 116

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

SSI对struts、spring、ibatis三者的整合过程

经过半个月的学习,在理解了struts、spring、ibatis的理论及流程后,总结一下SSI对该三者的整合过程 1.业务产生(比如查找) 2.查找struts.xml文件找到处理添加业务的Action类(如selectAction)(此时为struts框架) 3.根据selectAction中的execute方法,通知相应的DAO类(如userDAO)进行查找操作(进入ibatis框架)

===小虫=== 1807

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

ibatis与spring的整合

ibatis学习(三)---ibatis与spring的整合  <br />Spring通过DAO模式,提供了对iBATIS的良好支持。SqlMapClient对象是iBATIS中的主要对象,我们可以通过配置让spring来管理SqlMapClient对象的创建。<br />与hibernate类似,Spring 提供了SqlMapClientDaoSupport对象,我们的DAO可以继承这个类,通过它所提供的SqlMapClientTemplate对象来操纵数据库。看起来这些概念都与hibernate类

392

spring ibatis整合

Spring通过DAO模式,提供了对iBATIS的良好支持。SqlMapClient对象是iBATIS中的主要对象,我们可以通过配置让spring来管理SqlMapClient对象的创建。 与hibernate类似,Spring提供了SqlMapClientDaoSupport对象,我们的DAO可以继承这个类,通过它所提供的SqlMapClientTemplate对象来操纵数据库。看...

134

ibatis学习(三)---ibatis与spring的整合

Spring通过DAO模式,提供了对iBATIS的良好支持。SqlMapClient对象是iBATIS中的主要对象,我们可以通过配置让spring来管理SqlMapClient对象的创建。 与hibernate类似,Spring提供了SqlMapClientDaoSupport对象,我们的DAO可以继承这个类,通过它所提供的SqlMapClientTemplate对象来操纵数据库。看...

diliemu7730的博客 102

事务处理配置

spring和hibernate整合是事物处理配置 &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:s...

xiaoqi376847932的专栏 153

iBATIS与Spring集成及环境搭建

环境搭建依赖包: Spring 2.5.6依赖包: spring.jar aspectjrt.jar aspectjweaver.jar commons-dbcp.jar commons-pool.jar commons-beanutils.jar iBATIS依赖包: ibatis-2.3.0.677.jar mysql-connector-java-3.1.13-bin...

振华 248
上一篇: json-lib用法
下一篇: 在Spring中配置Hibernate事务
lhminjava
博客等级 码龄21年 15粉丝 6原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值