This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC 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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Urgent - DB2 XML entender" Watch "Urgent - DB2 XML entender" New topic
Author

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>
<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 !!!


Vladimir Ergovic
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Urgent - DB2 XML entender
 
Similar Threads
Problem looking up local interface of Session Beans - WSAD 5.1, WAS 5.0 Test Env
getInitParameter with a MessageDrivenBean
how can i locate the properties files within the ejb container?
env-entry tag
Problem Accessing Local EJB!!!!!!