Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

java.sql.SQLException: invalid column index

Status
Not open for further replies.

memphisTNdev22

Programmer
Jan 3, 2006
7
US
I am tring to execute the following query in a JSP and a I am getting a java.sql.SQLException: invalid column index
what am I doing wrong.....

String sqva = "Select atc.mobn, atc.accn, atc.acct_name, atc.act_date, rtrim(atc.svc_name), atc.comamt from atlcomm atc where atc.acin in ('PA','RA','FA') and rtrim(atc.svc_name) in (select c.svc_name from comm_bonus_rqrmnt_services c where c.ct_acts = 'Y' and c.req_type = 4 and '"+currDate+"' between c.act_month and NVL(c.end_month,to_char(sysdate,'yyyymm'))) and atc.sman in '"+pinCode+"' and atc.comm_date = '"+currDate+"' order by atc.mobn";

System.out.println("query is" + sqva);
LinkedList qryVa = new LinkedList();
ResultSet rsva = DbDisplay.executeQuery(sqva);
while (rsva.next()) {
List rows = new ArrayList();
for (int i=1; i < 7; i++) {
System.out.println("Sting is" + rsva.getString(i));
System.out.println("Sting is" + (i));
rows.add(rsva.getString(i));
if (i == 6) {
if (rsva.getString(i) != null) {
double comAmt = rsva .getDouble(i);
vactTotal = vactTotal + comAmt;
}
}
}
qryVa.add(rows);
}
rsva.close();
 
You already have those println-Statements, so you should tell us, what's the last thing, that gets displayed, with which index, and which line of code is provoking the error.

We don't have access to your tables.

seeking a job as java-programmer in Berlin:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top