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 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 Murach's Java Servlets and JSP this week in the Servlets 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: 15952
    
  19

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.
 
Don't get me started about those stupid light bulbs.
 
subject: how to write and read a CLOB field when using CMP
 
Similar Threads
How to read/write text file to db2 by using java code
CLOB field....
Converting a String to Clob for insert into DB
Mapping String To CLOB datatype using WSAD 4.0
Accessing Clob in CMP EJB