pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedException in running query
2+ messages / 2 participants
[nested] [flat]
* Exception in running query
@ 2007-04-10 17:14 Bellur Ashwin <bell_ashwin@yahoo.com>
0 siblings, 1 reply; 2+ messages in thread
From: Bellur Ashwin @ 2007-04-10 17:14 UTC (permalink / raw)
To: pgsql-jdbc
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/
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Exception in running query
@ 2007-04-10 17:57 Kris Jurka <books@ejurka.com>
parent: Bellur Ashwin <bell_ashwin@yahoo.com>
0 siblings, 0 replies; 2+ messages in thread
From: Kris Jurka @ 2007-04-10 17:57 UTC (permalink / raw)
To: Bellur Ashwin <bell_ashwin@yahoo.com>; +Cc: pgsql-jdbc
On Tue, 10 Apr 2007, Bellur Ashwin wrote:
> 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)
>
I cannot duplicate this result so I would have to suspect it has something
to do with your server modifications. If you reproduce this problem on a
stock server and driver please provide the exact versions of both and I
will investigate further.
Enabling protocol logging using the URL parameter loglevel=2 may help you
see where the driver is getting confused.
Kris Jurka
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2007-04-10 17:57 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-04-10 17:14 Exception in running query Bellur Ashwin <bell_ashwin@yahoo.com>
2007-04-10 17:57 ` Kris Jurka <books@ejurka.com>
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