# 连接接数据库时区设置
# jdbc:mysql://10.10.10.172:3306/lms?&useLegacyDatetimeCode=false&serverTimezone=UTC
# 显示所有表数据
# show tables;
# 创建表
# create table if not exists `student_tbl`(
# `sno` integer primary key ,
# `sname` varchar(20) not null ,
# `sage` integer not null ,
# `saddress` varchar(30) not null
# )
# 删除表
# drop TABLE student_tbl;
# 插入表数据库
# insert into student_tbl
# (sno,sname,sage,saddress)
# values
# (1,'美羊羊',10,'nj');
# 查询表数据
# select * from student_tbl;
# select sname,sage from student_tbl
# where sno =1;
# UPDATE 更新查询
# update student_tbl
# set sage = 10
# where sno = "1";
# 删除表中的记录
# delete from student_tbl
# where sno=1;
# like 模糊查询
# select * from student_tbl where sname like '%喜%';
# '%a' 以a结尾
# 'a%' 以a开头
#'%a%' 包含a
# '_a_' 三位且中间字母是a
# '_a' 两位且结尾字母是a
# 'a_' 两位且开头字母是a
idea连接mysql以及数据表的增删改查
最新推荐文章于 2023-07-20 09:57:17 发布