Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Urgent - DB2 XML entender

 
Vladimir Ergovic
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using BMP Entity Bean to store xml to a column but JDBC is cutting my data at 16K, 48K etc. There is no chance to store it complete. I ve already tried with setObject(..), setClob and setString but it doesn't work (acctualy it works for small xml but I have big ones like 2Mb and they don't fit only the small ones are OK.
This is the code:
<env-entry>
<env-entry-name>sql.ejbCreate</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>insert into paket_xml (paket_id,xml_signed,mbr,xml_msg) values (?,?,?, ?)</env-entry-value>
</env-entry>

String packetId,
String signedXmlMessage,
String xmlMessage,
String mbr)
throws javax.ejb.CreateException {
PreparedStatement ps = null;
try {
connect();
ps = con.prepareStatement(EnviromentUtil.getEnvString("sql.ejbCreate"));
ps.setString(1, packetId);
ps.setObject(2, signedXmlMessage.getBytes(), Types.BLOB);
ps.setString(3, mbr);
//ps.setString(4, ); //.getBytes(),Types.CLOB);
//ps.setObject(4,xmlMessage.getBytes(),Types.LONGVARCHAR);
//ps.setClob(4,xmlMessage);
ps.setObject(4, this.xmlMessage.getBytes(), Types.BLOB);
int rez = ps.executeUpdate();
} catch (Exception e) {
e.printStackTrace();
throw new EJBException("ejbCreate: " + e.getMessage());
}
this.xmlMessage = xmlMessage;
this.signedXmlMessage = signedXmlMessage;
this.packetId = packetId;
this.mbr = mbr;
return new ArchiveEntityKey(packetId);
}
..
So if anyone have any kid please HELP !!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic