欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 前端技术 > javascript >内容正文

javascript

Spring Boot 入门 IDEA 版本 2小时学会springBoot 代码上传至gitee 或者github 事务没做出来

发布时间:2023/12/3 javascript 57 豆豆
生活随笔 收集整理的这篇文章主要介绍了 Spring Boot 入门 IDEA 版本 2小时学会springBoot 代码上传至gitee 或者github 事务没做出来 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

SpringBoot简化了xml的配置可以快速开发,节省很多的时间,springboot的配置速度更快,SpringMvc已经不如springboot了,

市面上更多的是使用spingboot这个框架了。 

springboot是springmvc的升级版,但是2者没有必然的联系。可以直接学习springboot。

微服务当下大小公司都是在用的,非常火,

spingCloud是建立在springboot的基础上的,spingcloud是为微服务打基础的。

 

 

代码上传至gitee或者github

如果写@value注解就要累死了

 

 

 

这种只要了解就好了      现在都是前后端分离的     不会使用这种      使用模板会对性能带来很大的损耗。  不推荐使用这种方式。

 

 

 

 

 

这里运行一直报错  是mysql包没有引入

spring:profiles:active: dev#active: dev pro prod(无法启动)datasource:driver-class-name: com.mysql.jdbc.Driverurl: jdbc:mysql://127.0.0.1:3306/dbgirl?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8username: rootpassword: rootjpa:hibernate:ddl-auto: create

//查询一个女生 版本不一样有时候不行的 @GetMapping(value = "/girls/{id}") public Girl girlFindOne(@PathVariable("id") Integer id){return girlRepository.findById(id).get(); }

照着做没做出了   事务这里  也不知道为什么 ???  有空问问胡玉海

找到原因了是  数据库不支持事务MyIsam   修改为InnoDB就可以了

 

 

代码别忘了推送github上去!!!!!!!!!!!!

https://github.com/yangjiabinylg/girl    推送成功了  在github上面了

 

 

alter table girl type=InnoDB  --没用

CREATE TABLE `girl` (
  `id` int(11) NOT NULL,
  `age` int(11) DEFAULT NULL,
  `cup_size` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

 

 

 

[SQL]CREATE TABLE `girl`(
`id` int(11) NOT NULL,
`age` int(11) DEFAULT NULL,
`cup_size` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
受影响的行: 0
时间: 1.166s

[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

总结

以上是生活随笔为你收集整理的Spring Boot 入门 IDEA 版本 2小时学会springBoot 代码上传至gitee 或者github 事务没做出来的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。