File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Inserting BLOB from Java Application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Inserting BLOB from Java Application" Watch "Inserting BLOB from Java Application" New topic

Inserting BLOB from Java Application

Zulfikar Dharmawan
Ranch Hand

Joined: Feb 01, 2002
Posts: 74
I'm trying to insert BLOB into DB2 UDB 7.2 in Windows 2000, which I have managed to do that. I use put the file into ByteArrayOutputStream and then using PreparedStatement, i use the setBytes method to put it to database. It worked, but... DB2 UDB has limitation. The default query heap size of it is only 4,3 MB. I can increase it to any number but then again i think that won't be the solution, considering how many memory resource will be wasted just to accomodate large file.
So, my question is do you guys know how to insert BLOB piece by piece. More like using getChunck and appendChunk in Visual Basic?
Please, help me guys, thanks before...
[ March 07, 2003: Message edited by: Zulfikar Dharmawan ]

Zulfikar Dharmawan
SCJP1.4, ICS DB2, ICD Websphere
I agree. Here's the link:
subject: Inserting BLOB from Java Application
It's not a secret anymore!