• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Blob formatted in XML

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
i wrote a code which gets the blob object from the database and using the bufferedinputstream i read the blob as bytestream.

Blob b = rs.getBlob("TCblob");
String XmlString = "";
BufferedInputStream bis = new BufferedInputStream(b.getBinaryStream());
byte []bt = new byte[50];
XmlString = "<Request><row>" + bt+ "</row></Request>";
System.out.println(XmlString);
processXml(XmlString);

In the method processXMl

NodeList ls1 = doc.getElementsByTagName("row");

String b = ls1.item(0).getFirstChild().getNodeValue();
byte [] bt = b.getBytes();
System.out.println(bt);

problem here is i found both byte arrays are different by printing on the console. So how to get the same data throught parsing the XML??
please reply..
 
I need a new interior decorator. This tiny ad just painted every room in my house purple.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic