Re: next() and PreparedStatement - Mailing list pgsql-jdbc

From Jens Carlberg
Subject Re: next() and PreparedStatement
Date
Msg-id 3B8C00D0.BCD5E0B9@lysator.liu.se
Whole thread Raw
In response to RE: next() and PreparedStatement  ("chris markiewicz" <cmarkiew@commnav.com>)
List pgsql-jdbc
> i believe that when you close the stmt, the rs is automatically
> closed.  you have to leave the stmt open until you're done with the
> rs.

Exactly. If you read the Java documentation for interface
java.sql.Statement, method close(), it tells you the Resultset, if any,
also is closed on that call. PreparedStatement extends Statement,
CallableStatement extends PreparedStatement.

It's important to notice that the Postgres implementation of Resultset
et al is meant to work as described in the standard Java documentation;
that's the whole point of the interfaces. Thus a lot of these questions
can be answered by carefully reading through the standard Java
documentation.

Yours,
///Jens Carlberg


pgsql-jdbc by date:

Previous
From: Barry Lind
Date:
Subject: Re: Proposal to fix Statement.executeBatch()
Next
From: Ricardo Pardini
Date:
Subject: JDBC version