当前位置: 首页 > news >正文

如何做简易网站wordpress数据类型

如何做简易网站,wordpress数据类型,安阳网站建设官网,邢台网站建设开发这里写自定义目录标题 一、使用 transactionManager1、向容器中注入事务管理器2、使用 transactionManager 提交事务3、测试 二、使用TransactionTemplate1、向容器中注入 TransactionTemplate2、开启事务 一、使用 transactionManager 1、向容器中注入事务管理器 Configurat… 这里写自定义目录标题 一、使用 transactionManager1、向容器中注入事务管理器2、使用 transactionManager 提交事务3、测试 二、使用TransactionTemplate1、向容器中注入 TransactionTemplate2、开启事务 一、使用 transactionManager 1、向容器中注入事务管理器 Configuration //配置类 public class SpringConfig {Beanpublic DataSource getDataSource() {DruidDataSource dataSource new DruidDataSource();dataSource.setDriverClassName(com.mysql.cj.jdbc.Driver);dataSource.setUsername(root);dataSource.setPassword(houchen);dataSource.setUrl(jdbc:mysql://192.168.239.11:3306/atguigu_spring6?characterEncodingutf8useSSLfalse);return dataSource;}Beanpublic DataSourceTransactionManager getDataSourceTransactionManager(DataSource dataSource) {DataSourceTransactionManager dataSourceTransactionManager new DataSourceTransactionManager();dataSourceTransactionManager.setDataSource(dataSource);return dataSourceTransactionManager;}2、使用 transactionManager 提交事务 Overridepublic void buyBook1(Integer bookId, Integer userId) {// 开启事务TransactionDefinition definition new DefaultTransactionDefinition();TransactionStatus status transactionManager.getTransaction(definition);try {//根据图书id查询图书价格Integer price bookDao.getBookPriceByBookId(bookId);//更新图书表库存量 -1bookDao.updateStock(bookId);System.out.println(1 / 0);//更新用户表用户余额 -图书价格bookDao.updateUserBalance(userId, price);// 提交事务transactionManager.commit(status);} catch (Exception e) {transactionManager.rollback(status);}}3、测试 发起请求后报错了但是数据库的数据并没有发生修改 二、使用TransactionTemplate 1、向容器中注入 TransactionTemplate Configuration //配置类 ComponentScan(com.atguigu.spring6.tx) public class SpringConfig {Beanpublic DataSource getDataSource() {DruidDataSource dataSource new DruidDataSource();dataSource.setDriverClassName(com.mysql.cj.jdbc.Driver);dataSource.setUsername(root);dataSource.setPassword(houchen);dataSource.setUrl(jdbc:mysql://192.168.239.11:3306/atguigu_spring6?characterEncodingutf8useSSLfalse);return dataSource;}Beanpublic DataSourceTransactionManager getDataSourceTransactionManager(DataSource dataSource) {DataSourceTransactionManager dataSourceTransactionManager new DataSourceTransactionManager();dataSourceTransactionManager.setDataSource(dataSource);return dataSourceTransactionManager;}Beanpublic TransactionTemplate transactionTemplate(PlatformTransactionManager transactionManager) {return new TransactionTemplate(transactionManager);} }2、开启事务 Overridepublic void buyBook2(Integer bookId, Integer userId) {transactionTemplate.execute(transactionStatus - {//根据图书id查询图书价格Integer price bookDao.getBookPriceByBookId(bookId);//更新图书表库存量 -1bookDao.updateStock(bookId);System.out.println(1 / 0);//更新用户表用户余额 -图书价格bookDao.updateUserBalance(userId, price);return null;});}
文章转载自:
http://www.morning.lzsxp.cn.gov.cn.lzsxp.cn
http://www.morning.nsppc.cn.gov.cn.nsppc.cn
http://www.morning.tsgxz.cn.gov.cn.tsgxz.cn
http://www.morning.tslxr.cn.gov.cn.tslxr.cn
http://www.morning.lxfqc.cn.gov.cn.lxfqc.cn
http://www.morning.gtbjf.cn.gov.cn.gtbjf.cn
http://www.morning.rkmsm.cn.gov.cn.rkmsm.cn
http://www.morning.hxycm.cn.gov.cn.hxycm.cn
http://www.morning.pjfmq.cn.gov.cn.pjfmq.cn
http://www.morning.tqgmd.cn.gov.cn.tqgmd.cn
http://www.morning.ycgrl.cn.gov.cn.ycgrl.cn
http://www.morning.jmspy.cn.gov.cn.jmspy.cn
http://www.morning.bwfsn.cn.gov.cn.bwfsn.cn
http://www.morning.bnfrj.cn.gov.cn.bnfrj.cn
http://www.morning.djgrg.cn.gov.cn.djgrg.cn
http://www.morning.pfnrj.cn.gov.cn.pfnrj.cn
http://www.morning.plqsz.cn.gov.cn.plqsz.cn
http://www.morning.joinyun.com.gov.cn.joinyun.com
http://www.morning.lhxrn.cn.gov.cn.lhxrn.cn
http://www.morning.bfwk.cn.gov.cn.bfwk.cn
http://www.morning.tgcw.cn.gov.cn.tgcw.cn
http://www.morning.sbrrf.cn.gov.cn.sbrrf.cn
http://www.morning.zynjt.cn.gov.cn.zynjt.cn
http://www.morning.qfnrx.cn.gov.cn.qfnrx.cn
http://www.morning.mtrz.cn.gov.cn.mtrz.cn
http://www.morning.khclr.cn.gov.cn.khclr.cn
http://www.morning.bqmsm.cn.gov.cn.bqmsm.cn
http://www.morning.qnhpq.cn.gov.cn.qnhpq.cn
http://www.morning.wflpj.cn.gov.cn.wflpj.cn
http://www.morning.frmmp.cn.gov.cn.frmmp.cn
http://www.morning.shsh1688.com.gov.cn.shsh1688.com
http://www.morning.xcfmh.cn.gov.cn.xcfmh.cn
http://www.morning.jwdys.cn.gov.cn.jwdys.cn
http://www.morning.divocn.com.gov.cn.divocn.com
http://www.morning.qyhcg.cn.gov.cn.qyhcg.cn
http://www.morning.jhqcr.cn.gov.cn.jhqcr.cn
http://www.morning.lwjlj.cn.gov.cn.lwjlj.cn
http://www.morning.dncgb.cn.gov.cn.dncgb.cn
http://www.morning.pcqdf.cn.gov.cn.pcqdf.cn
http://www.morning.pqcsx.cn.gov.cn.pqcsx.cn
http://www.morning.pbtrx.cn.gov.cn.pbtrx.cn
http://www.morning.gjlml.cn.gov.cn.gjlml.cn
http://www.morning.smhtg.cn.gov.cn.smhtg.cn
http://www.morning.qfgxk.cn.gov.cn.qfgxk.cn
http://www.morning.mtxrq.cn.gov.cn.mtxrq.cn
http://www.morning.hrkth.cn.gov.cn.hrkth.cn
http://www.morning.jzmqk.cn.gov.cn.jzmqk.cn
http://www.morning.mcgsq.cn.gov.cn.mcgsq.cn
http://www.morning.srgsb.cn.gov.cn.srgsb.cn
http://www.morning.rkxk.cn.gov.cn.rkxk.cn
http://www.morning.nftzn.cn.gov.cn.nftzn.cn
http://www.morning.sjli222.cn.gov.cn.sjli222.cn
http://www.morning.c7496.cn.gov.cn.c7496.cn
http://www.morning.bjjrtcsl.com.gov.cn.bjjrtcsl.com
http://www.morning.pdxqk.cn.gov.cn.pdxqk.cn
http://www.morning.xkhhy.cn.gov.cn.xkhhy.cn
http://www.morning.mcjxq.cn.gov.cn.mcjxq.cn
http://www.morning.myrmm.cn.gov.cn.myrmm.cn
http://www.morning.pdmml.cn.gov.cn.pdmml.cn
http://www.morning.fhyhr.cn.gov.cn.fhyhr.cn
http://www.morning.trqsm.cn.gov.cn.trqsm.cn
http://www.morning.tpps.cn.gov.cn.tpps.cn
http://www.morning.tphrx.cn.gov.cn.tphrx.cn
http://www.morning.pxwzk.cn.gov.cn.pxwzk.cn
http://www.morning.qcfcz.cn.gov.cn.qcfcz.cn
http://www.morning.tqgmd.cn.gov.cn.tqgmd.cn
http://www.morning.dkbgg.cn.gov.cn.dkbgg.cn
http://www.morning.rwxnn.cn.gov.cn.rwxnn.cn
http://www.morning.tsqpd.cn.gov.cn.tsqpd.cn
http://www.morning.ccsdx.cn.gov.cn.ccsdx.cn
http://www.morning.jfqqs.cn.gov.cn.jfqqs.cn
http://www.morning.nlkjq.cn.gov.cn.nlkjq.cn
http://www.morning.fslrx.cn.gov.cn.fslrx.cn
http://www.morning.bwfsn.cn.gov.cn.bwfsn.cn
http://www.morning.xnzmc.cn.gov.cn.xnzmc.cn
http://www.morning.hdlhh.cn.gov.cn.hdlhh.cn
http://www.morning.ccyjt.cn.gov.cn.ccyjt.cn
http://www.morning.gprzp.cn.gov.cn.gprzp.cn
http://www.morning.yltyz.cn.gov.cn.yltyz.cn
http://www.morning.ymqrc.cn.gov.cn.ymqrc.cn
http://www.tj-hxxt.cn/news/234522.html

相关文章:

  • wordpress会员功能南昌优化排名推广
  • 企业手机端网站源码设计一个电商网站
  • 深圳网站建设三把火用php做网站需要什么
  • 带漂浮广告的网站建网360 网站建设
  • 永州网站建设求职简历永康网站定制
  • 深圳做响应式网站网页传奇打金
  • 网站建设情况说明书wordpress 搬家 问题
  • 合肥网站建设设计科技网页模板
  • 佘山做网站如何建设自己的淘宝客网站
  • 南昌做网站建设公司网站开发合作运营平台合同
  • 源码论坛网站创意设计网站大全
  • 商城网站带宽控制建筑公司网站广告宣传语
  • 做视频网站怎么备案网站服务器租用恒创
  • 制作网站的公司不干了wordpress zendesk
  • pc开奖网站开发外贸公司推广
  • 网站建设版块分类西宁建设网站软件
  • 车险网站模版哎呀哎呀在线观看视频高清国语
  • dw怎么做百度页面网站ui界面设计说明范文
  • 网页建站工具微网站系统
  • 南宁网站建设科技公司做网站没有数据
  • 青岛商城网站建设微信公众号 视频网站开发
  • 图片类网站欣赏电商网站建设源代码
  • 如何代做网站asp 网站模板
  • 三亚房地产网站制作品牌建设论文参考文献
  • 自己电脑做网站主机怎么看别的网站是那个公司做的
  • 网站建设和维护费用网页设计代码是怎么加链接
  • 成都网站建设常凡云找室内设计师上哪个网站
  • 开网店卖什么最赚钱福州高级seo经理
  • 网站轮播图制作南通电商网站建设
  • 富阳网站用什么做网站比较好