Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
Facebook
Downloads
Home
>
mailing lists
How to retieve binary data (bytea) without problem ? - Mailing list pgsql-jdbc
From
Alfredo Rico
Subject
How to retieve binary data (bytea) without problem ?
Date
September 28, 2005
17:28:03
Msg-id
89cc056d050928132714e17730@mail.gmail.com
Whole thread
Raw
Responses
Re: How to retieve binary data (bytea) without problem ?
List
pgsql-jdbc
Tree view
Hi friends, greetings :-)
I'm using PostgreSQL v7.4.7 with JDBC driver version 8.0 Build 312 in a Java Web Deveploment.
I have a table named 'attachedfiles' in which there is a column used to store binary data (bytea type) (pdf's files, doc, png, jpg, what ever...).
I have stored, without troubles, binary data reaching 30 MB.
To retrieve the binary data I'm using the following Java code:
PreparedStatement ps = this.con.prepareStatement("SELECT contentfile from attachedfiles where filename = ? ", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
ps.setString(1,"UsingJDBC.pdf");
bytes filebinary[] = null;
ResultSet rs = ps.executeQuery();
if (rs != null)
{
while (rs.next()) //Only one row
{
filebinary = rs.getBytes(1); //Obtain the file...
}
rs.close();
}
ps.close();
Problem:
If the binary data that I want to retrieve, is up to 12 MB, I obtain a java.lang.OutOfMemoryError: Java Heap Space.
I'm using NetBeans 4.1 and a I have increased the JVM heap size uing the following comand at momento to start Netbeans IDE
$ ./netbeans -J-Xmx300m
but this don't work.
How could I overcome this error ?
Thanks in advance by your help and support.
Kind Regards.-
Alfredo Rico.
pgsql-jdbc
by date:
Previous
From:
Oliver Jowett
Date:
27 September 2005, 21:20:30
Subject:
Re: Exception storing ipaddress with JBoss after upgrade to
Next
From:
"Pedro Mendes"
Date:
28 September 2005, 19:17:33
Subject:
Problem getting a connection with Postgres 8.0.3
Есть вопросы? Напишите нам!
Соглашаюсь с условиями обработки персональных данных
I confirm that I have read and accepted PostgresPro’s
Privacy Policy
.
I agree to get Postgres Pro discount offers and other marketing communications.
✖
×
×
Everywhere
Documentation
Mailing list
List:
all lists
pgsql-general
pgsql-hackers
buildfarm-members
pgadmin-hackers
pgadmin-support
pgsql-admin
pgsql-advocacy
pgsql-announce
pgsql-benchmarks
pgsql-bugs
pgsql-chat
pgsql-cluster-hackers
pgsql-committers
pgsql-cygwin
pgsql-docs
pgsql-hackers-pitr
pgsql-hackers-win32
pgsql-interfaces
pgsql-jdbc
pgsql-jobs
pgsql-novice
pgsql-odbc
pgsql-patches
pgsql-performance
pgsql-php
pgsql-pkg-debian
pgsql-pkg-yum
pgsql-ports
pgsql-rrreviewers
pgsql-ru-general
pgsql-sql
pgsql-students
pgsql-testers
pgsql-translators
pgsql-www
psycopg
Period
anytime
within last day
within last week
within last month
within last 6 months
within last year
Sort by
date
reverse date
rank
Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
By continuing to browse this website, you agree to the use of cookies. Go to
Privacy Policy
.
I accept cookies