pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bellur Ashwin <bell_ashwin@yahoo.com>
To: pgsql-jdbc@postgresql.org
Subject: Exception in running query
Date: Tue, 10 Apr 2007 10:14:11 -0700 (PDT)
Message-ID: <758357.44713.qm@web50604.mail.re2.yahoo.com> (raw)

Hi,
I issued one query to postgres using JDBC, it returned an exception saying the specified column does not exist. My java code handles this exception and subsequently when i try to run some other queries i am getting the following exception:

java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
    at java.util.ArrayList.RangeCheck(ArrayList.java:546)
    at java.util.ArrayList.get(ArrayList.java:321)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1223)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:175)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:389)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:314)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:221)


my java code is

Statement stmt1=conn.createStatement();
try{

    ResultSet rs1=stmt1.executeQuery("select * from emp where e1<=100");    
/* col e1 does not exist in table emp but table  */                                                                                                                       /*      emp exist  */

  }catch(Exception e)
    {
        e.printStackTrace();
    }

Statement stmt2=conn.createStatement();
try{

    ResultSet rs2=stmt2.executeQuery("select * from emp");            //Here i am getting exception

 }catch(Exception e)
{
    e.printStackTrace();                                   
}


Can i know where the problem is?

With Regards,
Bellur Ashwin




      Send a FREE SMS to your friend's mobile from Yahoo! Messenger. Get it now at http://in.messenger.yahoo.com/

view thread (2+ messages)  latest in thread

Message-ID: <758357.44713.qm@web50604.mail.re2.yahoo.com>
Permalink:  ../758357.44713.qm@web50604.mail.re2.yahoo.com/
Also on:    postgresql.org/message-id/758357.44713.qm@web50604.mail.re2.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: bell_ashwin@yahoo.com
  Subject: Re: Exception in running query
  In-Reply-To: <758357.44713.qm@web50604.mail.re2.yahoo.com>
  References: <758357.44713.qm@web50604.mail.re2.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox