我有两个在MYSQL中创建的表,
第一张表
create table employee(empID int primary key auto_increment,fName varchar(100), civilId int,mobile int);
第二个表,
create table employeeAttendance (
id int primary key auto_increment, empID int not null ,
fName varchar (100),timeIn time ,timeOut time ,
daay date,
foreign key (empID) references employee(empID)
);
我想将empID与第二个表格联系起来,我在网络编码中遇到了问题,在这里它是:
String sql="insert into employeeAttendance(empID,fName,timeIn,daay)values(?,?,?,?)";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,);
我应该在()之间写什么来将它们链接在一起?谢谢大家