2 Replies - 374 Views - Last Post: 30 April 2017 - 05:42 AM

#1 karengsh  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 129
  • Joined: 18-May 09

What is the syntax error I have made in MySQL statement ?

Posted 29 April 2017 - 04:24 AM

Dear experts,

I would like to know exactly what kind of mistake I have made in my Insert Statement cos really I think there is no mistake at all.

Database : MySQL

private static final String INSERT_QRY = "INSERT INTO hi5project.tutor(tutorName,tutorNRIC, tutorEmail, tutorAddress1, tutorAddress2, zipcode, tutorContactNo, tutorAge, tutorGender, tutorQualification, tutorQualificationDetail, tutorRates, tutorRemarks, tutorSubjects VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?)";




I have not included the id as it is auto-incremental.

and the error it says :

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?)' at line 1

Is This A Good Question/Topic? 0
  • +

Replies To: What is the syntax error I have made in MySQL statement ?

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13400
  • View blog
  • Posts: 53,478
  • Joined: 12-June 08

Re: What is the syntax error I have made in MySQL statement ?

Posted 29 April 2017 - 07:47 AM

I would check if you have all the closing parenthesis.
Was This Post Helpful? 0
  • +
  • -

#3 karengsh  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 129
  • Joined: 18-May 09

Re: What is the syntax error I have made in MySQL statement ?

Posted 30 April 2017 - 05:42 AM

View Postmodi123_1, on 29 April 2017 - 02:47 PM, said:

I would check if you have all the closing parenthesis.


Hi Modi123_1,

I have made the changes as you suggested but I am getting the same error message

private static final String INSERT_QRY = "INSERT INTO hi5project.tutor(tutorName,tutorNRIC, tutorEmail, tutorAddress1, tutorAddress2, zipcode, tutorContactNo, tutorAge, tutorGender, tutorQualification, tutorQualificationDetail, tutorRates, tutorRemarks, tutorSubjects)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?)";


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1