Bookmark Topic Watch Topic
  • New Topic

java.sql.SQLException: Invalid column index

 
satya saipune
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Report post to moderator
I am reading columns from a table... but it gives java.sql.SQLException: Invalid column index runtime sql exception


ResultSet resultSetone1 = null,resultSettwo = null;
Acd acd =new Acd();
try {
// Check arguments

out = new FileOutputStream("D://SimpleEx//acd.txt");

connection = acd.getOracleConnection();

statement = connection.createStatement ();
//String sQueryone = "select tcd.call_ref_no,tcd.lanfaxid,tcd.resolved, tcd.curr_status, tcd.group_code from FORESEE.t_call_details tcd where tcd.call_ref_no in (select tc.call_ref_no from FORESEE.t_call tc where tc.start_datetime between TO_DATE('"+maxTime+"','MM/DD/YYYY HH24:MI:SS')and sysdate)";;
String sQueryone = "SELECT expirydate FROM acdtds.elecsubscription WHERE expirydate >= sysdate";

System.out.println("1 Querying....." + sQueryone);

resultSetone1 = statement.executeQuery(sQueryone);
int count1 = 0;
while (resultSetone1.next())
{
out.write(resultSetone1.getBytes(0));
out.write(',');
}
}
// On exceptions, print error message and usage message
catch (Exception e) {
System.err.println(e);
System.err.println("Usage: getURL []");
}
finally { // Always close the streams, no matter what.
try {
in.close();
out.close();
}
catch (Exception e) {}

}
}
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hmm. Two users posting exactly the same question. What's going on here?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
same IP
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34669
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
Odd. Let's close this one and continue discussion in the other thread which already has some replies.
 
    Bookmark Topic Watch Topic
  • New Topic