pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Grittner <kgrittn@ymail.com>
To: Hannes Erven <hannes@erven.at>
To: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: Re: executeQuery() throws "Statement has been closed"
Date: Thu, 31 Jul 2014 07:52:46 -0700
Message-ID: <1406818366.83671.YahooMailNeo@web122301.mail.ne1.yahoo.com> (raw)
In-Reply-To: <53DA04A9.2030101@erven.at>
References: <53DA04A9.2030101@erven.at>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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


-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



view thread (10+ messages)  latest in thread

Message-ID: <1406818366.83671.YahooMailNeo@web122301.mail.ne1.yahoo.com>
Permalink:  ../1406818366.83671.YahooMailNeo@web122301.mail.ne1.yahoo.com/
Also on:    postgresql.org/message-id/1406818366.83671.YahooMailNeo@web122301.mail.ne1.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: kgrittn@ymail.com, hannes@erven.at
  Subject: Re: executeQuery() throws "Statement has been closed"
  In-Reply-To: <1406818366.83671.YahooMailNeo@web122301.mail.ne1.yahoo.com>
  References: <53DA04A9.2030101@erven.at> <1406818366.83671.YahooMailNeo@web122301.mail.ne1.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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