i have written a code to insert data in data base its is
String sql="INSERT INTO check (name,pass,pno) VALUES (?,?,?)";
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setString(1, name);
pstmt.setString(2, pass);
pstmt.setInt(3, no1);
pstmt.executeUpdate();
As i have avoided the sql injection and used preparedstatement i am still getting this error in my server log:
SEVERE: 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 'check (name,pass,pno) VALUES ('Nikhil Muskur','qwerty1',7898455)' at line 1
i double checked it as nothing is wrong with the syntax then what is the problem can anybody help