- 首页 > 生活 > >
会话跟踪技术 - Cookie 和 Session 快速上手 + 登陆注册案例( 七 )
数据库
- tb_user
-- 删除tb_user表drop table if exists tb_user;-- 创建用户表CREATE TABLE tb_user( id int primary key auto_increment, username varchar(20) unique, password varchar(32));-- 添加数据INSERT INTO tb_user(username,password) values('zhangsan','123'),('lisi','234');SELECT * FROM tb_user; - tb_brand
-- 删除tb_brand表drop table if exists tb_brand;-- 创建tb_brand表create table tb_brand( -- id 主键 id int primary key auto_increment, -- 品牌名称 brand_name varchar(20), -- 企业名称 company_name varchar(20), -- 排序字段 ordered int, -- 描述信息 description varchar(100), -- 状态:0:禁用 1:启用 status int);-- 添加数据insert into tb_brand (brand_name, company_name, ordered, description, status)values ('三只松鼠', '三只松鼠股份有限公司', 5, '好吃不上火', 0), ('华为', '华为技术有限公司', 100, '华为致力于把数字世界带入每个人、每个家庭、每个组织,构建万物互联的智能世界', 1), ('小米', '小米科技有限公司', 50, 'are you ok', 1);SELECT * FROM tb_brand;
实体类
User.java
package priv.dandelion.entity;public class Brand { // id 主键 private Integer id; // 品牌名称 private String brandName; // 企业名称 private String companyName; // 排序字段 private Integer ordered; // 描述信息 private String description; // 状态:0:禁用 1:启用 private Integer status; public Brand() { } public Brand(String brandName, String companyName, Integer ordered, String description, Integer status) { this.id = null; this.brandName = brandName; this.companyName = companyName; this.ordered = ordered; this.description = description; this.status = status; } public Brand(Integer id, String brandName, String companyName, Integer ordered, String description, Integer status) { this.id = id; this.brandName = brandName; this.companyName = companyName; this.ordered = ordered; this.description = description; this.status = status; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getBrandName() { return brandName; } public void setBrandName(String brandName) { this.brandName = brandName; } public String getCompanyName() { return companyName; } public void setCompanyName(String companyName) { this.companyName = companyName; } public Integer getOrdered() { return ordered; } public void setOrdered(Integer ordered) { this.ordered = ordered; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public Integer getStatus() { return status; } public void setStatus(Integer status) { this.status = status; } @Override public String toString() { return "Brand{" + "id=" + id + ", brand_name='" + brandName + '\'' + ", company_name='" + companyName + '\'' + ", ordered=" + ordered + ", description='" + description + '\'' + ", status=" + status + '}'; }}
经验总结扩展阅读
-
-
百娱星谈 魔兽60轮回服:P1阶段这些道具价值很高,得其一者千G马无忧
-
时尚装修设计大全|餐桌总是堆满杂物? 这些餐边柜设计一个比一个实用,照着装准没错
-
-
-
-
-
我从小父母离异|我生双胞胎我妈来照顾,孩子满月前,她给我说件事,听完后我傻了
-
-
-
奶奶是十里八乡有名的长寿老人 给90岁奶奶做的早餐,晒朋友圈火了,朋友:搭配合理营养还美味
-
小伙吃鱼不吐刺 60岁阿姨一天直播14小时,做菜带货还“挽救”粉丝婚姻
-
-
-
-
-
-
-
-