Mysql&msaccess: Insert Into Table Which Have An Incremented Field
I am sorry if there is a duplicate but I tried all ways still I can't do the insertion. I have a table with only two fields ( ID , Name ) When I run this SQL code it must be inser
Solution 1:
change pr.setString(2,"Azad"); to pr.setString(1,"Azad");
The first parameter is related to the position of the ? in the prepared statement, not the column index in the table.
java.sql.SQLException: No value specified for parameter 1. This is down to the fact that you have specified two parameters for the query. But have only specified one value, for the second parameter. If "ID" is an auto incremented column then you don't need to pass in a value. If its not then
pr.setString(1,IDVALUE);
pr.setString(2,"Azad");
Post a Comment for "Mysql&msaccess: Insert Into Table Which Have An Incremented Field"