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.