File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 15629
    
  15

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
 
Similar Threads
Accessing Clob in CMP EJB
Mapping String To CLOB datatype using WSAD 4.0
CLOB field....
Converting a String to Clob for insert into DB
How to read/write text file to db2 by using java code