These are the codes. I cant see any error there. Please kindly help. Thanks.
void saveMedicalReco rds() {
try {
Class.forName(d river);
Connection connection = DriverManager.g etConnection(ur l2, username, password);
Statement statement = connection.crea teStatement();
sql = "INSERT INTO medicalrecords (NRIC, Time, Diagnosis, MC, NoOfDays, Prescription1, Qty1, Prescription2, Qty2, Prescription3, Qty3, Prescription4, Qty4, Prescription5, Qty5, Additional) VALUES ('"+txtPID3.get Text()+"',"+tim eNow+",'"+txtDi agnosis.getText ()+"',"+MC_Stri ng+",'"+txtDays .getText()+"',' "+txtDrug1.getT ext()+"',"+txtQ 1.getText()+",' "+txtDrug2.getT ext()+"',"+txtQ 2.getText()+",' "+txtDrug3.getT ext()+"',"+txtQ 3.getText()+",' "+txtDrug4.getT ext()+"',"+txtQ 4.getText()+",' "+txtDrug5.getT ext()+"',"+txtQ 5.getText()+",' "+txtAdd.getTex t()+"')";
System.out.prin tln("sql is : "+sql);
statement.execu teUpdate(sql);
connection.clos e();
}
catch (Exception ex){
ex.printStackTr ace();
}
saySavedMedical Records();
}
void saveMedicalReco rds() {
try {
Class.forName(d river);
Connection connection = DriverManager.g etConnection(ur l2, username, password);
Statement statement = connection.crea teStatement();
sql = "INSERT INTO medicalrecords (NRIC, Time, Diagnosis, MC, NoOfDays, Prescription1, Qty1, Prescription2, Qty2, Prescription3, Qty3, Prescription4, Qty4, Prescription5, Qty5, Additional) VALUES ('"+txtPID3.get Text()+"',"+tim eNow+",'"+txtDi agnosis.getText ()+"',"+MC_Stri ng+",'"+txtDays .getText()+"',' "+txtDrug1.getT ext()+"',"+txtQ 1.getText()+",' "+txtDrug2.getT ext()+"',"+txtQ 2.getText()+",' "+txtDrug3.getT ext()+"',"+txtQ 3.getText()+",' "+txtDrug4.getT ext()+"',"+txtQ 4.getText()+",' "+txtDrug5.getT ext()+"',"+txtQ 5.getText()+",' "+txtAdd.getTex t()+"')";
System.out.prin tln("sql is : "+sql);
statement.execu teUpdate(sql);
connection.clos e();
}
catch (Exception ex){
ex.printStackTr ace();
}
saySavedMedical Records();
}
Comment