0
異常是列索引超出範圍:16,列數:15。嵌套異常是org.postgresql.util.PSQLException:列索引超出範圍:16,列數:15.使用此查詢提交表單時。請建議。你的幫助將是可觀的。在使用spring-mvc提交表單時不在db中插入
@覆蓋 公衆詮釋insertNewApplication(TokenApplicantDetails TPD) {
String sql = "INSERT INTO token_applicant_details"
+ "(application_no,applicant_name, applsex, "
+ "designation, date_of_superannuation, "
+ "phone_no, mobile_no, "
+ "office_type_code,ou_code,token_manufacturer_code,token_user_id,token_password, "
+"certificate_no,certificate_issue_date,certificate_expiry_date, "
+"fixed_ip_address,ref_no,form_type,original_application_receiving_date, "
+"scanned_application_receiving_date,residential_address,staff_status, "
+"email_id, enrollment_no, dispatch_no,fixed_ip_active, "
+"refId,Deacivated_on) VALUES (null,?, ?, ?,to_date(?,'DD/MM/YYYY'), ?, ?, ?, ?, ?, ?, ?,null,null,null,null,null,?,null,null,?,?,?,null,null,null,null,null)";
System.out.println("not inserted");
return jdbcTemplate.update(sql,new Object[]{tpd.getApplication_no(),tpd.getApplicant_name(), tpd.getApplsex(),tpd.getDesignation(),tpd.getDate_of_superannuation(),tpd.getPhone_no(),tpd.getMobile_no(),
tpd.getOffice_type_code(),tpd.getOu_code(),tpd.getToken_manufacturer_code(),tpd.getToken_user_id(),tpd.getToken_password(),tpd.getCertificate_no(),tpd.getCertificate_issue_date(),tpd.getCertificate_expiry_date(),
tpd.getFixed_ip_address(),tpd.getRef_no(),tpd.getForm_type(),tpd.getOriginal_application_recieving_date(),
tpd.getScanned_application_recieving_date(),tpd.getResidential_address(),tpd.getStaff_status(),
tpd.getEmail_id(),tpd.getEnrollment_no(),tpd.getDispatch_no(),tpd.getFixed_ip_address(),tpd.getRefId(),tpd.getDeactivated_on(),});
}
您在sql和輸入參數之間有不同的參數數量。 – Blank
如何?你能建議如何改正它嗎?請詳細說明。 –