I have not tried to use a clob as a cmp field, but I have worked with clobs using JDBC. If I recall, one cannot directly access clobs in the database as a java.lang.String unless the strings are streamed (i.e. using the PreparedStatement.setAsciiStream or ResultSet.getAsciiStream). I don't think jBoss streams strings if the field is filed as a java.lang.String.
I would try mapping the column to oracle.sql.CLOB and use accessor methods to set and get the field as if it were mapped as a java.lang.String. Look at the Oracle documentation (if you don't have it you can always go to technet.oracle.com) to see how to work with oracle.sql.CLOB object.
Good luck.
--Jonathan
-----Original Message-----
From: Shahar [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 06, 2000 7:34 AM
To: [EMAIL PROTECTED]
Subject: [jBoss-User] CLOB field in CMP entity
Hi jBoss users !
My problem is as follows :
I have an Oracle 8.1.6 table :
(myID NUMBER,
myName VARCHAR2(100),
myOpinion CLOB)
I want to represent a row in this table as an entity-bean.
I want to make it a CMP entity-bean.
I would like to refer to myOpinion filed as a java.lang.String.
i.e. ,I would like to be able to code this in the remote interface:
public void setMyOpinion(java.langString myOpinion) throws RemoteException;
public java.lang.String getMyOpinion() throws RemoteException;
I would also like the create method to have the following signature:
(int myID,String myName,String myOpinion)
Can I have jBoss manage the CLOB field persistance ?
Can I declare the field as java.lang.String ?
How should my jaws.xml look like for this field ?
Should I map java.lang.String to jdbc-type CLOB ? or do something else ?
I have tried many combinations of type declaring, mapping and coding, but
each failed.
Should I assume jBoss doesnt support CLOB CMP-fileds ???
Please help, Shahar.
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]
