File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Inserting BLOB data Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Inserting BLOB data" Watch "Inserting BLOB data" New topic
Author

Inserting BLOB data

Mainak Goswami
Ranch Hand

Joined: May 21, 2006
Posts: 50

Hi,

I am facing a very critical issue when we try to insert a file in the blob column in the Oracle database.
Steps for inserting data in Blob column in Oracle.
1) Insert other fields and EMPTY_BLOB() in the Table T1.
2) Getting the byte array of the file and updating the blob column with this value.

Issue:
This is working fine with file of size less than 4KB. But if it is more than '4KB' it is giving the following error:
"java.sql.SQLException: Data size bigger than max size for this type: 10640"

Code snippet:-

dao.setBytes(1, objAttachment.getFileObject()); //getFileObject() returns byte[]

Please suggest how can we resolve this issue.

Many thanks


------------------------------------
Mainak
idiotechie
------------------------------------
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Inserting BLOB data
 
Similar Threads
Please help me complete steps to upload an image
Not able to insert image more than 4K in Database
Storing in BLOC column.
how to upload size > 4k file to oracle BLOB field
BLOB column storage issue