From: Stephen McConnell <mcconnell_stephen@yahoo.com>
To: pgsql-jdbc@postgresql.org
Subject: An I/O error occured while sending to the backend.
Date: Fri, 14 Jan 2005 13:59:21 -0800 (PST)
Message-ID: <20050114215921.61369.qmail@web41506.mail.yahoo.com> (raw)
I am developing using the new PostgreSQL 8.0.0 rc5 under Windoz XP
(sorry).
I am also using Eclipse with the MyEclipseWorkbench and ACCESSING A
DATABASE ON localhost. In the code I make a valid connection and
immediately set up a prepared statement and execute a query.
The code is:
pstmt = connection.prepareStatement(SQL_GET_SEQUENCE);
pstmt.setString(1, this.name);
rs = pstmt.executeQuery();
The query is:
private static final String SQL_GET_SEQUENCE =
"SELECT " +
"seed " +
"FROM " +
"stocks.sequencer " +
"WHERE " +
"name = ?";
or
SELECT seed FROM stocks.sequencer WHEREname = 'test_sequence'
I am using the pg80b1.308jdbc3.jar jdbc driver.
The above query works through pgAdmin III and the MyEclipse Database
Explorer.... But when I run the above java code I receive the infamous
Exception: java.io.IOException: Stream closed
Stack Trace:
java.io.IOException: Stream closed
at sun.nio.cs.StreamEncoder.ensureOpen(StreamEncoder.java:38)
at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:151)
at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:213)
at org.postgresql.core.PGStream.flush(PGStream.java:485)
at
org.postgresql.core.v3.QueryExecutorImpl.sendSync(QueryExecutorImpl.java:616)
at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:165)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:363)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:308)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:223)
at com.scawa.stockanalyzer.db.Sequencer.reseed(Sequencer.java:95)
at com.scawa.stockanalyzer.db.Sequencer.next(Sequencer.java:73)
at com.scawa.stockanalyzer.test.Tester.main(Tester.java:46)
Others have said this is a TCP/IP problem with a firewall, but it's
pretty apparent that since I'm accessing "localhost"
(jdbc:postgresql://localhost:5432/test_database) that It's not a
"firewall" problem UNLESS there's a problem with the Windoz XP
firewall.
Any ideas? Suggestions?
Stephen McConnell
=====
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: mcconnell_stephen@yahoo.com
Subject: Re: An I/O error occured while sending to the backend.
In-Reply-To: <20050114215921.61369.qmail@web41506.mail.yahoo.com>
References: <20050114215921.61369.qmail@web41506.mail.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