标签:connect ram varchar info primary 技术 学生 prope table
开发工具:Eclipse Java EE IDE 2018-09 (4.9.0) + MySQL Workbench 8.0
1. 准备数据库
1.1 新建数据库 students
1.2 新建两张表 tblstudents,tblmanagers,用于存放学生信息(学号,名字,性别)和管理员信息(工号,密码)
CREATE TABLE `students`.`tblstudents` ( `stuNum` INT NOT NULL, `Name` VARCHAR(45) NOT NULL, `Gender` TINYINT(1) NOT NULL, PRIMARY KEY (`stuNum`)); CREATE TABLE `students`.`tblmanagers`( `mngNum` INT NOT NULL, `Name` VARCHAR(45) NOT NULL, `Passwd` VARCHAR(45) NOT NULL, PRIMARY KEY (`mngNum`));
1.3 随便塞点数据
INSERT INTO tblstudents(stuNum, Name, Gender) VALUE (001,"Mary",0),(002,"Tom",1),(003,"Jassie",0); INSERT INTO tblmanagers(mngNum, Name, Passwd) VALUE (101,"Apple","apl123"),(102,"Banana","JDKUIELKLD");
1.4 在Eclipse中导入MySQL驱动包 mysql-connector-java-8.0.13.jar
标签:connect ram varchar info primary 技术 学生 prope table
原文地址:https://www.cnblogs.com/truelycloud/p/10129050.html