What are some common practices in storing XML data in a J2EE application? My co-workers want to store the XML String directly in an entity bean.
We are attempting to use CMP entity beans first but the problem is that Java Strings are translated to VARCHAR(256) and our XML documents are definitely longer than 256 characters. I believe we can use BMP instead and persist the XML string to the data type TEXT.
Another approach is to store an object graph of the XML document. This graph would be very similar to the DOM tree for the XML. This seems to be a lot of work for merely persisting XML documents. The parsing and serializing of the objects may prove too costly.
What are your thoughts in this matter?
Thanks,
Charles
--
Charles Ng
Senior Internet Developer
cng at internetivity dot com
613-729-4480 x305
InterNetivity Inc. - The Information Outreach Pioneer
Visit The Analysis Engine for the Web at http://www.databeacon.com
-
Storing XML in Entity Beans? (4 messages)
- Posted by: Charles Ng
- Posted on: January 26 2001 17:56 EST
Threaded Messages (4)
- Storing XML in Entity Beans? by VIVEK SHARAN on January 27 2001 02:31 EST
- Storing XML in Entity Beans? by KEN YU on January 29 2001 17:01 EST
-
Storing XML in Entity Beans? by Tyler Jewell on January 30 2001 06:20 EST
- Storing XML in Entity Beans? by Gavin Spurling on January 31 2001 12:54 EST
-
Storing XML in Entity Beans? by Tyler Jewell on January 30 2001 06:20 EST
- Storing XML in Entity Beans? by KEN YU on January 29 2001 17:01 EST
-
Storing XML in Entity Beans?[ Go to top ]
- Posted by: VIVEK SHARAN
- Posted on: January 27 2001 02:31 EST
- in response to Charles Ng
I tpp would like to know about it. What more i can think of is how to create an XML doc from the resultset i obtain. Are there any APIs available which are doing this or i have to create one of my own. -
Storing XML in Entity Beans?[ Go to top ]
- Posted by: KEN YU
- Posted on: January 29 2001 17:01 EST
- in response to VIVEK SHARAN
Vivek
Though not platform independent, check out XSQL from Oracle. -
Storing XML in Entity Beans?[ Go to top ]
- Posted by: Tyler Jewell
- Posted on: January 30 2001 18:20 EST
- in response to KEN YU
Have you tried looking at what storing the data as a CLOB will do for you? -
Storing XML in Entity Beans?[ Go to top ]
- Posted by: Gavin Spurling
- Posted on: January 31 2001 12:54 EST
- in response to Tyler Jewell
We've just done something similar here. We use CMP for the main properties of an XML document, (id, name, type, etc..), and use BMP (via set() and get() methods) for setting CLOB's in an oracle database via a DataSource. We wrap it round a stateless bean which has methods for pulling the CLOBs out of the DB quickly as well. Works very well.