Re: executeQuery() throws "Statement has been closed" - Mailing list pgsql-jdbc

From Kevin Grittner
Subject Re: executeQuery() throws "Statement has been closed"
Date
Msg-id 1406818366.83671.YahooMailNeo@web122301.mail.ne1.yahoo.com
Whole thread Raw
In response to executeQuery() throws "Statement has been closed"  (Hannes Erven <hannes@erven.at>)
List pgsql-jdbc
Hannes Erven <hannes@erven.at> wrote:

> sometimes my application (jdbc-1101, hibernate, desktop application)
> reports the following "Statement has been closed" error:

> ... I'm wondering why there is even checkClosed() called before
> returning the value of a field?
> Could that check be safely removed?

Not according to the API documentation:

http://docs.oracle.com/javase/7/docs/api/java/sql/Statement.html#getMaxRows%28%29

| Throws:
|     SQLException - if a database access error occurs or this method is called on a closed Statement

Besides, if a Statement has been closed, why would you expect it to
still be usable?

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: executeQuery() throws "Statement has been closed"
Next
From: Hannes Erven
Date:
Subject: Re: executeQuery() throws "Statement has been closed"