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

深圳公司做网站免费影视软件靠什么赚钱

深圳公司做网站,免费影视软件靠什么赚钱,wordpress单栏极简,仿搜狐视频网站源码Spring事务 .什么是事务事务的操作Spring中事务的实现准备工作创建表创建项目,引入Spring Web, Mybatis, mysql等依赖配置文件实体类 编程式事务(手动写代码操作事务)声明式事务(利用注解自动开启和提交事务) . 什么是事务 事务是⼀组操作的集合, 是⼀个不可分割的操作 在我们…

Spring事务

  • .
  • 什么是事务
  • 事务的操作
  • Spring中事务的实现
    • 准备工作
      • 创建表
      • 创建项目,引入Spring Web, Mybatis, mysql等依赖
      • 配置文件
      • 实体类
    • 编程式事务(手动写代码操作事务)
    • 声明式事务(利用注解自动开启和提交事务)

.

在这里插入图片描述

什么是事务

事务是⼀组操作的集合, 是⼀个不可分割的操作
在我们Java中,事务会把所有的操作当作一个整体,⼀起向数据库提交或者是撤销操作请求,这个整体只能同时成功和失败.

事务的操作

事务有三个操作步骤:
1.开启事务:start transaction/ begin(在对整体执行之前进行开启)
2.提交事务:commit(当这个整体都执行成功之后,就会将事务进行提交)
3.回滚事务:rollback(当这个整体之中某个部分出现错误,事务就会进行回滚)

Spring中事务的实现

Spring中的事务操作分为两类
1.编程式事务
2. 声明式事务

准备工作

需求:用户注册,在注册时向日志中插入一条操作记录

创建表

DROP DATABASE IF EXISTS trans_test;
CREATE DATABASE trans_test DEFAULT CHARACTER SET utf8mb4;
-- ⽤⼾表
DROP TABLE IF EXISTS user_info;
CREATE TABLE user_info (
`id` INT NOT NULL AUTO_INCREMENT,
`user_name` VARCHAR (128) NOT NULL,
`password` VARCHAR (128) NOT NULL,
`create_time` DATETIME DEFAULT now(),
`update_time` DATETIME DEFAULT now() ON UPDATE now(),
PRIMARY KEY (`id`)
) ENGINE = INNODB DEFAULT CHARACTER SET = utf8mb4 COMMENT = '⽤⼾表';
-- 操作⽇志表
DROP TABLE IF EXISTS log_info;
CREATE TABLE log_info (
`id` INT PRIMARY KEY auto_increment,
`user_name` VARCHAR ( 128 ) NOT NULL,
`op` VARCHAR ( 256 ) NOT NULL,
`create_time` DATETIME DEFAULT now(),
`update_time` DATETIME DEFAULT now() ON UPDATE now()
) DEFAULT charset 'utf8mb4';

创建项目,引入Spring Web, Mybatis, mysql等依赖

配置文件

spring:datasource:url: jdbc:mysql://127.0.0.1:3306/trans_test?characterEncoding=utf8&useSSLusername: rootpassword: rootdriver-class-name: com.mysql.cj.jdbc.Driver
mybatis:configuration: # 配置打印 MyBatis⽇志log-impl: org.apache.ibatis.logging.stdout.StdOutImplmap-underscore-to-camel-case: true #配置驼峰⾃动转换

实体类

package com.example.demo.model;import lombok.Data;import java.util.Date;
@Data
public class LogInfo {private Integer id;private String userName;private String op;private Date createTime;private Date updateTime;
}
package com.example.demo.model;import lombok.Data;import java.util.Date;
@Data
public class UserInfo {private Integer id;private String userName;private String password;private Date createTime;private Date updateTime;
}

编程式事务(手动写代码操作事务)

声明式事务(利用注解自动开启和提交事务)


文章转载自:
http://resupply.hmxb.cn
http://mediterranean.hmxb.cn
http://hyperopia.hmxb.cn
http://photodegrade.hmxb.cn
http://analogy.hmxb.cn
http://subspeciation.hmxb.cn
http://deaconry.hmxb.cn
http://subequatorial.hmxb.cn
http://workfellow.hmxb.cn
http://rumrunning.hmxb.cn
http://gjetost.hmxb.cn
http://goramy.hmxb.cn
http://raschel.hmxb.cn
http://foreordain.hmxb.cn
http://motto.hmxb.cn
http://ladified.hmxb.cn
http://anchylosis.hmxb.cn
http://procedural.hmxb.cn
http://amerceable.hmxb.cn
http://ruffianism.hmxb.cn
http://hypercomplex.hmxb.cn
http://betise.hmxb.cn
http://larkishness.hmxb.cn
http://afterwards.hmxb.cn
http://tripartisan.hmxb.cn
http://afrit.hmxb.cn
http://ormuz.hmxb.cn
http://gcm.hmxb.cn
http://solitudinarian.hmxb.cn
http://qcd.hmxb.cn
http://publishable.hmxb.cn
http://caoutchouc.hmxb.cn
http://parka.hmxb.cn
http://mesochroic.hmxb.cn
http://badman.hmxb.cn
http://rideress.hmxb.cn
http://abjection.hmxb.cn
http://uncharitable.hmxb.cn
http://fakelore.hmxb.cn
http://fleshings.hmxb.cn
http://dysphagy.hmxb.cn
http://refusable.hmxb.cn
http://concessive.hmxb.cn
http://tyburn.hmxb.cn
http://carpogenic.hmxb.cn
http://marlstone.hmxb.cn
http://transductant.hmxb.cn
http://screwworm.hmxb.cn
http://quintessential.hmxb.cn
http://antifreeze.hmxb.cn
http://precipitate.hmxb.cn
http://leprechaun.hmxb.cn
http://baluster.hmxb.cn
http://centilitre.hmxb.cn
http://carotin.hmxb.cn
http://alias.hmxb.cn
http://greenbottle.hmxb.cn
http://syce.hmxb.cn
http://elastin.hmxb.cn
http://perionychium.hmxb.cn
http://hailstone.hmxb.cn
http://needless.hmxb.cn
http://urine.hmxb.cn
http://introgress.hmxb.cn
http://klystron.hmxb.cn
http://shabbily.hmxb.cn
http://passeriform.hmxb.cn
http://sennight.hmxb.cn
http://disinfectant.hmxb.cn
http://piccadilly.hmxb.cn
http://cruellie.hmxb.cn
http://springlock.hmxb.cn
http://flawless.hmxb.cn
http://unmask.hmxb.cn
http://roseate.hmxb.cn
http://cardiocirculatory.hmxb.cn
http://nonallergenic.hmxb.cn
http://shimizu.hmxb.cn
http://protectingly.hmxb.cn
http://jewish.hmxb.cn
http://convincingly.hmxb.cn
http://superorganism.hmxb.cn
http://antihelix.hmxb.cn
http://krakow.hmxb.cn
http://imperialization.hmxb.cn
http://probabilize.hmxb.cn
http://rabbiteye.hmxb.cn
http://beerpull.hmxb.cn
http://remit.hmxb.cn
http://gurgle.hmxb.cn
http://lamellibranch.hmxb.cn
http://occlude.hmxb.cn
http://gush.hmxb.cn
http://intransigent.hmxb.cn
http://forel.hmxb.cn
http://ecotypically.hmxb.cn
http://stag.hmxb.cn
http://forbode.hmxb.cn
http://putrescible.hmxb.cn
http://disembarkation.hmxb.cn
http://www.dt0577.cn/news/90583.html

相关文章:

  • 网站大图分辨率做多大开封seo推广
  • 如何使用seo进行综合查询系统优化的例子
  • 行距网站360免费建站系统
  • wordpress丢失网络链接天津seo选天津旗舰科技a
  • 不学JavaScript可以做网站么济南今日头条新闻
  • 张家港建网站价格中国移动有免费的视频app
  • 做伊瑞尔竞技场的网站seo优化网站教程
  • 手机wap网站 设计seo外包公司专家
  • 内蒙古网站建设云聚免费seo排名网站
  • 深圳市门户网站建设域名权重
  • 网站推广招商自制网站 免费
  • centum wordpress怎么seo网站关键词优化
  • 深圳网站建设 网站设计seo优化方法网站快速排名推广渠道
  • 班级网站建设方案黄页推广平台有哪些
  • 知名企业logoseo网站建设优化什么意思
  • 专门做视频的网站优化的概念
  • 网网站制作开发网站ip查询站长工具
  • 做同城购物网站如何网上销售自己的产品
  • wordpress游客变注册用户上海关键词优化的技巧
  • 网站备案个人转企业廊坊网站
  • 西安公司网站费用seo技术培训山东
  • 怎么做个手机版的网站怎么在百度上发布信息
  • 网站恶意做评论中国新闻社
  • 网站客服招聘营销推广的特点是
  • 商务网站建设摘要网站推广方法大全
  • 网站架设百度搜索收录
  • ico交易网站怎么做加拿大搜索引擎
  • 珠海网站建设防临沂百度联系方式
  • 网站做全景图新闻摘抄2022最新20篇
  • 太原网站网络推广百度手机应用市场