Chapter 8 Creating J2EE Applications for BEA WebLogic


BLOB and CLOB DBMS Column Support for the Oracle DBMS

WebLogic Server supports Oracle BLOB and CLOB DBMS columns with EJB CMP. BLOBs and CLOBs are data types used for large objects. CLOBs are string or char objects; BLOBs are binary or serializable objects such as pictures that translate into large byte arrays.

BLOBs and CLOBs map a string variable, a value of OracleBlob or OracleClob, to a BLOB or CLOB column. WebLogic Server only maps CLOBs to the data type, java.lang.string. At this time, no support is available for mapping char arrays to a CLOB column.

Steps To: enable BLOB/CLOB support:

  1. In the bean class, declare the variable.
  2. Edit the XML by declaring the dbms-column-type deployment descriptor in the weblogic-cmp-rdbms jar.xml file.
  3. Create the BLOB or CLOB in the Oracle database.

Using BLOB or CLOB may cause performance to be slower than normal because of the size of the BLOB/CLOB object.

BLOB example

<field-map>
	<cmp-field>photo</cmp-field>
	<dbms-column>PICTURE</dbms-column>
	<dbms_column-type>OracleBlob</dbms-column-type>
</field-map>

CLOB example

<field-map>
	<cmp-field>description</cmp-field>
	<dbms-column>product_description</dbms-column>
	<dbms_column-type>OracleClob</dbms-column-type>
</field-map>

 


Copyright (C) 2005. Sybase Inc. All rights reserved.