aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes how to write and read a CLOB field when using CMP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "how to write and read a CLOB field when using CMP" Watch "how to write and read a CLOB field when using CMP" New topic
Author

how to write and read a CLOB field when using CMP

Sean Li
Ranch Hand

Joined: Feb 27, 2002
Posts: 154
I have a table which contains CLOB field, the database i'm using is oracle. when write value to the database when creating or updating a record, when read data from the record, i need to set or get this CLOB field. but how? how to write the codes? because i'm using CMP, it's more convenient but complicated.
could anybody help me?? thanks!
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16308
    
  22

CLOB should map to an EJB field of type java.lang.String.


Customer surveys are for companies who didn't pay proper attention to begin with.
mindows
Greenhorn

Joined: Sep 24, 2002
Posts: 2
doesn't that depend on what kind of ejb container you use? for example, wls 5.1 doesn't even support clob or blob in cmp. you have to use bmp to access clob/blob columns. wls 7 has OracleBlob for oracle blob or clob. which container lets you just map clob columns to java.lang.String?
Sean Li
Ranch Hand

Joined: Feb 27, 2002
Posts: 154
I've heard weblogic 7 surport Oracle's clob field. but must add <dbms-column-type>OracleClob</dbms-column-type> in the weblogic-cmp-rdbms-jar.xml. and the get and set methods are defined to return and accept java.lang.String.
and I tried, it really works when writting into the table, but when read from the tabel, i got null.
could anybody help me?
Sean Li
Ranch Hand

Joined: Feb 27, 2002
Posts: 154
can anybody reply my question? really need your help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to write and read a CLOB field when using CMP