I'm trying to enter data into two different tables with the same form, but i seem to have an error most probably with data types
the method below is supposed to enter data into two mysql tables namely employees and login
the data types for the fields in the employee table are as follows
id -int
firstname - text
middlename -text
lastname - text
date_of_birth -date
age - int
wage - double
the data types for the mysql login table are as follows
id - int
username - text
password - text
times late - int
hours worked - time
private void txtsaveActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
try{
connection();
String id = txtid.getText();
String first = txtfirst.getText();
String middle = txtmiddle.getText();
String last = txtlast.getText();
String date = txtdob.getText();
String age = txtage.getText();
String user = txtuser.getText();
String pass = txtpass.getText();
String late = txtlate.getText();
String hours = txthours.getText();
String wage = txtwage.getText();
double wages = Double.parseDouble(wage);
int iden = Integer.parseInt(id);
int old = Integer.parseInt(age);
DateFormat sdf = new SimpleDateFormat("yyyy/mm/dd/");
Date dates = sdf.parse(date);
DateFormat how = new SimpleDateFormat("hh:mm:ss");
Date here = how.parse(hours);
int latenom = Integer.parseInt(late);
stm.executeUpdate("INSERT INTO employees(ID,Firstname,Middlename,Lastname,Date_Of _Birth,Age,Wage)values('"+iden+ "','"+first+"','"+middle+"', '"+last+"', '"+dates+"','"+old+"','"+wages+"')");
JOptionPane.showMessageDialog(null, "Information successfully added to database");
}
catch(Exception hy){
JOptionPane.showMessageDialog(null, "Error Detected");
}
}