• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Inserting Large objects into Database

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..
 
Ranch Hand
Posts: 689
Scala Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Scala Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Ranch Hand
Posts: 874
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic