0

I tried connect mysql in java but there is compiler error.

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

I added mysql libraray but this is defective : Class.forName("com.mysql.jdbc.Driver");

What should I do?

3
  • 3
    You should include the SQL code in your question. Commented Jul 8, 2013 at 12:48
  • Your SQL query is probably wrong. Commented Jul 8, 2013 at 12:49
  • Are you sure, looks to me as exception not as compile error Commented Jul 8, 2013 at 12:49

1 Answer 1

1

MySQLSyntaxErrorException means that you are already connected to MySQL but you have some problems with your SQL script, that you're trying to execute.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.