cancel
Showing results for 
Search instead for 
Did you mean: 

BLOB/CLOB issue with SAP J2EE 6.40

Former Member
0 Kudos

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

www.csoftgroup.com

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Kumar

Can you please provide me your email.

Thanks & regads

Sai

Vlado
Advisor
Advisor
0 Kudos

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

Former Member
0 Kudos

Hi Vladimir,

You are right, this is the problem with OracleDB 9i;

We have fixed this the following way:

We have loaded the OracleDB 10g drivers into SAP WAS 6.40. It seems to be working fine.

I will provide more as we complete our testing;

Thank You,

Kumar

Vlado
Advisor
Advisor
0 Kudos

Hi Kumar,

It would be kind from your side if you <a href="https://www.sdn.sap.com/sdn/index.sdn?page=crp_help.htm#posted">rewarded some points</a> when answers on SDN were helpful.

Best regards,

Vladimir