wood burning stoves 2.0*
The moose likes JDBC and the fly likes How to Display the BLOB Field Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to Display the BLOB Field " Watch "How to Display the BLOB Field " New topic

How to Display the BLOB Field

gurusamy sengodan
Ranch Hand

Joined: Oct 13, 2005
Posts: 41
I have written the code to get the BLOB Fields from the table.
That BLOB Fields contain XML.
How to view the content of that BLOB Field i mean that XML.
I want to see the content of That XML.
The code snippet:-
Blob aBlob = resultSet.getBlob(1);

Now the aBlob contains the XML. How to display the content of aBlob.
I want to see the content through the code.

Thanks in Advance
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3703

Refer to the Blob API http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Blob.html

You can read the Blob as an InputStream and then for the most part treat it as you would read a file. You can pass the InputStream to a XML constructor and load it as an XML object.

My Blog: Down Home Country Coding with Scott Selikoff
I agree. Here's the link: http://aspose.com/file-tools
subject: How to Display the BLOB Field
Similar Threads
clob and blob
Displaying image from a BLOB stored in DB
How to get the BLOB
Challenging Blob read
How to see the content of BLOB Field