-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: how to retrieve an XML file from Database which is BLOB type
PostPosted: Wed Nov 15, 2006 1:43 pm 
Newbie

Joined: Tue Oct 31, 2006 7:09 am
Posts: 4
Hi,

Currently i am storing an Xml file as blob in my Mysql database using hibernate.

I am using createBlob method to convert my Xml file to blob type.

I need to know whether there is any method like this to retrive an XML file again from database which is in Blob type.Need to retrive the XML file from database.Any sample code or method i can get.

Code:

Blob tcxml = null;
      try
      {
          File tcxmlf = new File(newTcName);
          FileInputStream tcxmlfs = new FileInputStream(tcxmlf);

          tcxml = Hibernate.createBlob(tcxmlfs);
      } catch (Exception e) {
          System.out.println(e);
      }

in bean i will set it as
testcase.setTcxmlBlob(tcxml);

in hbm.xml file i have following property,

<property name="tcxmlBlob" column="TestcaseFile" type="blob" />



Thanks,
Srins.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.