This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes JDBC and Relational Databases 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 Head First Android this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "How to Display the BLOB Field " Watch "How to Display the BLOB Field " New topic
Author

How to Display the BLOB Field

gurusamy sengodan
Ranch Hand

Joined: Oct 13, 2005
Posts: 41
Hi,
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
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3740
    
  10

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.


[OCA 8 Book] [Blog]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Display the BLOB Field
 
It's not a secret anymore!