Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inserting Large objects into Database

 
lakshmi vasavi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to insert a PDF of size 800 kb into oracle data base, using Java
I tried set Bytes and set Binary stream. It seems both of them do not support this size of 800 kb.
When i get a blob and try to use SetBytes(), I am getting this exception:
"java.sql.SQLException: Unsupported feature"
Please help..
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Lakshmi,

Welcome to the Java ranch ...

You have to use BLOB for this...

try to use SetBytes(), I am getting this exception:


Check when you are setting value SetBytes() the contains you set is in form of Binary ?

 
lakshmi vasavi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do i create a BLOB? I have the contents in the form of byte array and input stream..
I have been trying to create BLOB but was not able to do
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Lakshmi,

I give you some link which will give you some idea about upload file and retrieve it from database ....

Store document to Database

http://forums.sun.com/thread.jspa?threadID=5329539

 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator




Integer.MAX_VALUE can handle 2 GB of data.
 
lakshmi vasavi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If i give Max_Value, I am getting java.lang.OutOfMemoryError error.
If i give the size of input stream as parameter for setBinaryStream, I am getting an RT exception saying "Data size bigger than max size for this type: 68823"
68823 is the lenght of the stream that i am trying to store in the data base.

Can i pass any other value for setBinaryStream?
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


"Data size bigger than max size for this type: 68823"
68823 is the lenght of the stream that i am trying to store in the data base


Where do you set that ? I guess it would be better to share the jdbc piece of code.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic