on 05-06-2005 9:17 AM
Hi,
We are in the process of porting weblogic J2EE based application into SAP WAS6.40. We have a problem with BLOB/CLOB data types; Backend is oracle 9i.
Our Bean CMP is defined as follows (field mapping)
Fieldname: metaData
FieldType : java.lang.String
Column Name: meta_data;
-
In the Oracle database, it is defined as follows:
Column name: meta_data;
Column type : CLOB
-
We have created the datasource as follows:
Created a data-source include the following attributes:
oracle.jdbc.xa.client.OracleXADataSource;
Vendor SQL selected.
We are able to connect to the database; No problem;
-
The generated code looks like this:
try{
iLoadStatement = conn.prepareStatement("select \"HMS_PROPERTY\".\"P_NAME\", \"HMS_PROPERTY\".\"DESCRIPTION\", \"HMS_PROPERTY\".\"META_DATA\" from \"HMS_PROPERTY\" where \"P_NAME\" = ? ");
iLoadStatement.setString(1, ejb_pkObject.name);
rset = iLoadStatement.executeQuery();
if (!rset.next()) {
beanPM = null;
BaseReliableNoSuchEntityException toThrow = new BaseReliableNoSuchEntityException(NEED_REFRESH);
toThrow.trace( LOCATION );
throw toThrow;
}
extract(rset);
}
// Extracts all data from the ResultSet
// CMR fields are initialized from their caches
public void extract(ResultSet rs) throws SQLException {
Object pk = null;
description = rs.getString("description");
metaData = rs.getString("meta_data");
loaded = true;
}
metaData is declared as java.lang.string type.
-
As you notice, metaData variable is of type string. According to J2EE documentation, this is perfectly fine to declare this way.
But, it is not working;
Do we have to do anything special for CLOB/BLOB data types?
Please advise.
Thank You,
cSoftgroup, Inc
Hi Kumar
Can you please provide me your email.
Thanks & regads
Sai
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kumar,
You've done everything right. The problem is not with the EJB Container in SAP Web AS but with the Oracle9i DB. According to <a href="http://www.oracle.com/technology/sample_code/tech/java/codesnippet/jdbc/clob10g/handlingclobsinoraclejdbc10g.html">Oracle</a>, ResultSet.getString() is not supported for the retrieval of CLOB data until Oracle10g.
Best regards,
Vladimir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.