File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Urgent - DB2 XML entender Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Urgent - DB2 XML entender" Watch "Urgent - DB2 XML entender" New topic

Urgent - DB2 XML entender

Vladimir Ergovic
Ranch Hand

Joined: Apr 22, 2001
Posts: 63
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-value>insert into paket_xml (paket_id,xml_signed,mbr,xml_msg) values (?,?,?, ?)</env-entry-value>

String packetId,
String signedXmlMessage,
String xmlMessage,
String mbr)
throws javax.ejb.CreateException {
PreparedStatement ps = null;
try {
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, this.xmlMessage.getBytes(), Types.BLOB);
int rez = ps.executeUpdate();
} catch (Exception e) {
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 !!!

Vladimir Ergovic
I agree. Here's the link:
subject: Urgent - DB2 XML entender
It's not a secret anymore!