i m using gettext() method in getting text from the form and pass it to the sql query to record in the mysql database. when i don't enter any string for textfield (for eg: phone no.) , i get sql exception error..
here is my sql query in the code..
String query= "INSERT INTO Table1( PatName, Dob, PatGender, PatAddress, PatPhoneno, PatMobile, PatRelative, Relation, AdmissionDate, DischargeDate, ClinicalFeature, Diagnosis, Treatment, Followup ) VALUES ('"+
txtPatName.getText() + "','"+
txtyear.getText()+"-"+txtmth.getText()+"-"+txtday.getText() + "','"+
(String)PatGender.getSelectedItem() + "','"+
txtPatAddress.getText() + "','"+
txtPhone.getText() +"','"+
txtMob.getText() +"','"+
txtRelname.getText() +"','"+
txtRelation.getText() +"','"+
txtAdmissiondate.getText() +"','"+
txtDischargedate.getText() +"','"+
txtclinical.getText() +"','"+
txtDiagnosis.getText() +"','"+
txtTreat.getText() +"','"+
txtFollowup.getText()+ "')";
can anyone help to solve how to solve this problem????