随笔分类 - Java
Java基本用法
摘要:原文链接 代码介绍 前端代码:https://github.com/Snowstorm0/token-login-vue 后端代码:https://github.com/Snowstorm0/token-login-spring 使用 Spring+Vue 实现 token 登录、退出、访问拦截等功
阅读全文
摘要:原文链接 当前时间 import java.sql.Timestamp; //导包 Timestamp nowTime = new Timestamp(System.currentTimeMillis()); System.out.println(nowTime); 输出: 2022-06-08 1
阅读全文
摘要:原文链接 JDBC一般指Java数据库连接(Java Database Connectivity) api 应用程序接口(API): 可以调用或者使用类/接口/方法等去完成某个目标 。 API制定的类/方法可以做什么 。 API由开发人员调用。 spi 服务提供接口(SPI) : 需要继承或实现某些
阅读全文
摘要:原文链接 代码地址 前端地址:https://github.com/Snowstorm0/SpringAndVue-vue 后端地址:https://github.com/Snowstorm0/SpringAndVue-spring 1 数据库 创建MySQL数据库。 表名为user_data,人员
阅读全文
摘要:原文链接 代码地址:https://github.com/Snowstorm0/learn-async 1 线程同步和异步 线程同步:A线程要请求某个资源,但是此资源正在被B线程使用中,因为同步机制存在,A只能等待下去。耗时较长,安全性较高。 线程异步:A线程要请求某个资源,但是此资源正在被B线程使
阅读全文
摘要:原文链接 Sprint Boot的完整实例,从数据库读取数据并使用Postman测试。 项目地址:https://github.com/Snowstorm0/learn-spring-boot 1 本地数据库 本地数据库创建教程: 创建本地数据库user_data: 2 代码主体 2.1 Contr
阅读全文
摘要:原文链接 1 Get请求数据 项目地址:https://github.com/Snowstorm0/learn-get-post 1.1 Controller 文件名MyController,内容为: @RestController @RequestMapping("/homepage") publ
阅读全文
摘要:原文链接 1 输出 System.out.print("sys_num:" + sys_num + "\n"); 2 String截取 截取前三位: String str = "abcde"; String str1 = str.substring(0,3); //abc 截取第一至倒数第二位: S
阅读全文