File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes java.sql.SQLException: Invalid column index Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Reply locked New topic

java.sql.SQLException: Invalid column index

satya saipune

Joined: Jan 31, 2007
Posts: 1
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 (
// On exceptions, print error message and usage message
catch (Exception e) {
System.err.println("Usage: getURL []");
finally { // Always close the streams, no matter what.
try {
catch (Exception e) {}

Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Hmm. Two users posting exactly the same question. What's going on here?

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

same IP
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32819

Odd. Let's close this one and continue discussion in the other thread which already has some replies.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: java.sql.SQLException: Invalid column index
It's not a secret anymore!