pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: patrick <pch@freeshell.org>
To: pgsql-jdbc@postgresql.org
Subject: Cannot Retrieve  Binary Data
Date: Fri, 11 Mar 2005 15:15:49 +0100
Message-ID: <5bd6ef364cb5f644245035172a720b30@freeshell.org> (raw)

Hi all ,
i'm following the example at 
http://www.postgresql.org/docs/7.4/interactive/jdbc-binary-data.html
trying to retrieve previous stored  file (more than 600MB) using the 
following code:

			Jdbc3ConnectionPool source = new Jdbc3ConnectionPool();
			conn = 
DriverManager.getConnection("jdbc:postgresql://localhost/backup", 
"test", "test");
			conn.setAutoCommit(false);
           		PreparedStatement ps = conn.prepareStatement("SELECT img 
FROM images WHERE imgname = ?");
			ps.setString(1, "civil.dmg");
			ResultSet rs = ps.executeQuery();
			if (rs != null) {
			    while (rs.next()) {
			        byte[] imgBytes = rs.getBytes(1);
			        // use the data in some way here
			    }
			    rs.close();
			}
			ps.close();
			conn.commit();

during the executeQuery() i got a the following exception

java.sql.SQLException: ERROR: invalid memory alloc request size 
2017394403

The Postgres version is 8.0.1 (compiled from source with default 
settings ) running on Darwin Kernel Version 7.8.0

Thanks in advance for any help

-patrick




view thread (5+ messages)  latest in thread

Message-ID: <5bd6ef364cb5f644245035172a720b30@freeshell.org>
Permalink:  ../5bd6ef364cb5f644245035172a720b30@freeshell.org/
Also on:    postgresql.org/message-id/5bd6ef364cb5f644245035172a720b30@freeshell.org

 · 

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: pch@freeshell.org
  Subject: Re: Cannot Retrieve  Binary Data
  In-Reply-To: <5bd6ef364cb5f644245035172a720b30@freeshell.org>
  References: <5bd6ef364cb5f644245035172a720b30@freeshell.org>

* 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