problem while insertion

Hi.. i am using jdbc to insert values into a table...The prepared statement is given below.....

PreparedStatement insertPaymentDetails = null;

String insertPaymentDetailsString = "INSERT INTO payment_details (inv_hdr_id,paid_amt,CHQ_RCVD_DT,CHQ_NO,PYMT_DT,PYMT_MODE,PYMT_TYPE,PYMT_BATCH_ID,created_by,created_date) values (?,?,?,?,?,?,?,?,?,?)";

insertPaymentDetails = con.prepareStatement(insertPaymentDetailsString);

insertPaymentDetails.setInt(1,var1);

insertPaymentDetails.setDouble(2,amt1);

insertPaymentDetails.setString(3,dt);

insertPaymentDetails.setInt(4,chk_no1);

insertPaymentDetails.setString(5,dt);

insertPaymentDetails.setString(6,pymt_mode);

insertPaymentDetails.setString(7,pymt_type);

insertPaymentDetails.setInt(8,var);

insertBatchPayment.setString(9,createdby);

insertBatchPayment.setString(10,createddate);

insertPaymentDetails.executeUpdate();

when i am running the program i get an error stating paramenter index out of bounds.....as shown below..

java.sql.SQLException: Parameter index out of bounds. 9 is not between valid values of 1 and 7

at com.mysql.jdbc.ServerPreparedStatement.getBinding(ServerPreparedStatement.java:752)

at com.mysql.jdbc.ServerPreparedStatement.setString(ServerPreparedStatement.java:1808)

at reformatOrders.transform(reformatOrders.java:243)

at org.jetel.component.Reformat.run(Reformat.java:232)

could u pls help me out...Thanx

[1511 byte] By [abhi@javaa] at [2007-10-3 4:31:24]
# 1
instead of insertPaymentDetails.setInt(1,var1);use actual column name like insertPaymentDetails.setInt("inv_hdr_id", var1);if problem is not solved the database field are long enough to store the data u want insert
yashyash1234a at 2007-7-14 22:34:50 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
wel am using the prepared statement.... so like for the position of the ? u hav to gv the field name with the relative no.
abhi@javaa at 2007-7-14 22:34:50 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...