I am getting the above mentioned exception while executing the SQL query in Java.
statement2.executeUpdate("INSERT INTO visit_header"
+ "VALUES('"+visitnumber+"','"+date+"','"+cookie+"','"+ip+"')");
I want to know where it is going wrong.
As per initial look, you have a problem in your sql query:
statement2.executeUpdate("INSERT INTO visit_header" + "VALUES
Should be
statement2.executeUpdate("INSERT INTO visit_header " + "VALUES //Note space after header
There was no space between visit_header and VALUES, so your query was like this:
INSERT INTO visit_headerVALUES
Which is wrong.