String query_creditCardDtls = " SELECT A.FUND_ACC_TYPE , C.BANK_CODE, D.KEY_2, A.DDA_ISSUE FROM DD300MB A, DD001MB C, CA840PB D WHERE A.BR_CD = C.BR_CD AND C.BR_CD = D.BR_CD AND A.BR_CD=? AND D.MOD_CD='DD' AND D.LANG_CD='EN' AND D.KEY_1 = 'ENTITY_ID' AND A.PAYING_BANK_ID = C.BANK_CODE AND A.REF_NO=? ";
ps=con.prepareStatement(query_creditCardDtls);
ps.setString(1,iBranchCode);
ps.setString(2,Txn_ref_no);
rs = ps.executeQuery();
if (rs.next()) {
strFundACType = rs.getString(1);
strPayingBankId = rs.getString(2);
strEntityId = rs.getString(3);
strDDAIssuedFor = rs.getString(4);
}
它给了我以下异常
java.sql.SQLException: Invalid column index
但似乎没有索引错误请帮忙
答案 0 :(得分:0)
第4列的类型可能与字符串不同。检查表定义。例如,如果第4列是整数,则使用getInt()而不是getString()
您也可以使用getString(columnname)。