I am trying to insert user inputted data into database, but am getting the error "Syntax error: Encountered "[" at line 1, column 160." Here is my code, what am I doing wrong?`
if (action.getSource() == Submit_button)
{
try
{
sql = "INSERT INTO Customer (FNAME, LNAME, AGE, LICNUM, STATE, CAR_TYPE, RENTDATE, RETURNDATE, TOTAL, PAYTYPE, RETURNED) VALUES(";
sql = sql + "'" + f_name.getText() + "'" + "," + "'" + l_name.getText() + "'" + "," + Age + "," + "'" + liscense_num.getText() + "'" + "," + "'"
+ issuing.getText() + "'" + "," + "'" + car_select.getToolkit() + "'" + "," + "'" + rental.getText() + "'" + "," + "'" + return_d.getText() + "'"
+ "," + total.getText() + "," + "'" + button_val.getText() + "'" + "," + "'true'" + ")";
myStatement.execute(sql);
System.out.print("Record has Been added to database");
}
catch (SQLException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}