• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Is there other way to getBlob

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to assign a string value to a Blob object.

Obviously there are many methods of Class can do this under java.sql package,but now the rule is changed, if there is a way out to get done this without the JDBC the ResultSet.getBlob(). If I use a hibernate and Struts,I get a string from view layer and have this value stored into the Transient object.

Thanks in advance!
 
author & internet detective
Posts: 42056
926
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
David,
Blobs are binary data whereas Strings are character data. A Clob maps to a String. Or a Blob can map to an array of bytes. Can you clarify a bit?
 
David Wong
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jeanne Boyarsky:
David,
Blobs are binary data whereas Strings are character data. A Clob maps to a String. Or a Blob can map to an array of bytes. Can you clarify a bit?



Thanks for so helpful information.But I have a field in Blob type in my database. It is like a web blog, I want this Blob field can store the text and photos as well. In fact I wanna all things from the client submited. I think since the Blob are binary data, so it can handle any type of data, besides string. and I confused by how converting this.

Consider this, I wrote a blog today, the content of this article is rich enough, it contains photos and words and other ASC codes like a carriage return symbol("\n"). I have all of this blog putted into the Blob field. That is what I am thinking about.

All information in a computer represented by binary data, so, string can trasform bytes data, but I search the API about Clob/Blob, they are interfaces and can be instantiated only by invoking JDBC methods, like ResultSet.getBlob()/getClob();

To sum up, I do not know how to make a Blob type take the client data.
 
Sunglasses. AKA Coolness prosthetic. This tiny ad doesn't need shades:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic