On 29 Sep 2000, Gunnar R|nning wrote:
> "Keith L. Musser" <kmusser@idisys.com> writes:
>
> > Gunnar,
> >
> > Your new JDBC driver (postgresql.jar, 29-Sept-2000, 14:47, 187K) caused
> > the following error.
> >
>
> >
> > SELECT host, port FROM Servers WHERE PID=1;
> > Bad Integer int4
> > at org.postgresql.jdbc2.ResultSet.getInt(ResultSet.java:261)
> > at org.postgresql.jdbc2.ResultSet.getObject(ResultSet.java:748)
> > at org.postgresql.jdbc2.ResultSet.getObject(ResultSet.java:789)
>
> OK, I found the problem. I will post a fixed version later today. The
> problem was that getObject() executed Field.getSQLType() which in turn
> executed Connection.ExecSQL(). I modified ExecSQL to deallocate the cached
> byte arrays on entry, because I believed it only were called by
> Statement.execute() methods. I guess I should move the deallocation into
> the Statement classes instead, as that is were it really belongs.
>
> I interpret the JDBC spec. to say that only one ResultSet will be open
> per. Statement, but one Connection canm have several statements with one
> result set each.
That is true, but you have to be careful of some of the DatabaseMetaData
methods as well, as some of them do issue their own queries to get their
results. It would be a pain to create new Statements just for them.
This area also has problems when transactions are being used, but without
nested transactions, it's a known problem :-(
Peter
--
Peter T Mount peter@retep.org.uk http://www.retep.org.uk
PostgreSQL JDBC Driver http://www.retep.org.uk/postgres/
Java PDF Generator http://www.retep.org.uk/pdf/