hi
I have create a table with 11 fields with field1 is primary key and auto incremented.
In java i use prepared statement.The code is working well without auto increment that is i add this value from my program. when i change field1 auto incremented and use prepared statement for 10 fields only, I have error "No value specified for parameter 1".
Also if I use prepared statement for 11 fields then what will b the parameters??
If i specified value of column1 then how it will be incremented in the database.
Please help me to fix the problem.
I the code is like this.
statement = connection.prepareStatement("INSERT INTO table1 VALUES(?,?,?,?,?,?,?,?,?,?,?)");
statement.setString(2, val2);
statement.setString(3, val3);
statement.setString(4, val4);
statement.setString(5, val5);
statement.setString(6, val6);
statement.setString(7, val7);
statement.setString(8, val8);
statement.setString(9, val9);
statement.setString(10, val10);
statement.setString(11, val11);