Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • 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 ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

How to retreive a blob....

Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I am trying to retreive a blob from the oracle using jdk1.3. I tried most of the method's as per the API but could not get any result.
blob = (java.sql.Blob) rs.getObject(3);
InputStream in = blob.getBinaryStream();
byte[] b_blob = new byte[blob.length()];
b_blob = in.getBytes(1, blob.length());
// length = blob.length();
// txtfield.append("Length of blob : " + length);
Is there any other way out to retreive the blob. I have tried get Blob method as well. Moreover, I am not able to print the length of the blob as well.
I was able to insert the blob in the oracle database but could not check it exactly what is going in. As I tried to import the table in MS Access, it give me long binary data(AS MS access does not have objects). Can any one please, help me in how to check what is inserted in the table and also how to retreive the blob....Sample code is most welcome.
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
here is a sample:
click on the
LOB Datatype
JDBC: Source

about the length issue:
this may be relevant or not..
When people don’t understand what you are doing they call you crazy. But this tiny ad just doesn't care:
Garden Master Course kickstarter
    Bookmark Topic Watch Topic
  • New Topic