Skip site navigation (1) Skip section navigation (2)

Re: NullPointerException in ResultSetMetaData getColumnCount

From: tomas(dot)johansson(at)agent25(dot)se (Tomas)
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: NullPointerException in ResultSetMetaData getColumnCount
Date: 2004-10-19 06:53:52
Message-ID: 2e107e13.0410182253.74c289af@posting.google.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
books(at)ejurka(dot)com (Kris Jurka) wrote in message news:<Pine(dot)BSO(dot)4(dot)56(dot)0410181515590(dot)5115(at)leary(dot)csoft(dot)net>...
> On Mon, 18 Oct 2004, Tomas wrote:
> 
> > How can you get metadata from a resultset that is returned from a
> > stored function ?
> 
> You need to be running with autocommit off for this to work at all.  This
> is not just a metadata problem.  The problem is that cursors are closed at
> commit, which in auto commit mode is before the results can even be
> fetched from it.  It could definitely use a better error message, the 8.0
> driver gives "ERROR: cursor "<unnamed portal 1>" does not exist", but 
> that's still not very good.
> 
> Kris Jurka

Thank you Kris for your answer.
I was using the 7.4 version of the driver since the PostgreSQL version
I am using is 7.4.5 but now I tested the 8.0 driver and then the
metadata seems to work. Regarding the 7.4 driver it did not help to
change the autocommit.
/ Tomas

In response to

pgsql-jdbc by date

Next:From: Kris JurkaDate: 2004-10-19 06:57:47
Subject: Re: Avoiding explicit addDataType calls for PostGIS
Previous:From: Kris JurkaDate: 2004-10-19 06:13:37
Subject: Re: FW: your post to pgjdbc-commit

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group