" NumberFormatException error occurs when i click the save button but i am not converting a string into a number. "
i tried :
try {
result = Integer.parseInt(input);
} catch(Exception e) {
if(input == null || input.isEmpty()) { // case 1a
return 0; //case 1a
}
try {
String sql = "INSERT INTO c_records (job_id,u_name,model,warranty,deposit,balance,date,status,technician,balance_paid,clearance_date) VALUES (?,?,?,?,?,?,?,?,?,?,?)";
pst = connect.prepareStatement(sql);
pst.setInt(1, Integer.valueOf(jTextField1.getText()));
pst.setString(2, jTextField2.getText());
pst.setString(3, jTextField3.getText());
pst.setInt(4, Integer.valueOf(jTextField4.getText()));
pst.setInt(5, Integer.valueOf(jTextField5.getText()));
pst.setInt(6, Integer.valueOf(jTextField6.getText()));
pst.setString(7, jTextField7.getText());
pst.setString(8, jTextField8.getText());
pst.setString(9, jTextField9.getText());
pst.setInt(10, Integer.valueOf(jTextField10.getText()));
pst.setString(10, jTextField10.getText());
pst.setString(11, jTextField11.getText());
pst.execute();
JOptionPane.showMessageDialog(null, "Record Saved!");
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null, e);
}
i want the send button the send the data to the DB.