Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is there other way to getBlob

 
David Wong
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • 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!
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33694
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic