CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.

YesSoftware Forums -> CodeCharge Studio -> Java

 View an Oracle Clob using java

Print topic Send  topic

Author Message

Posts: 35
Posted: 08/29/2007, 5:42 AM


Does anybody have a solution for viewing a clob field using jsp and CCS 3.2? All we are trying to do is select a clob field from the database and view it using a ccs report or grid.

View profile  Send private message

Posts: 31
Posted: 08/29/2007, 5:44 AM

And what happens?
View profile  Send private message

Posts: 35
Posted: 08/29/2007, 5:50 AM

If I set the field as Memo, it displays "oracle.sql.CLOB@xxxxxx" instead of the actual data.
View profile  Send private message

Posts: 386
Posted: 08/29/2007, 6:42 AM

I change class DbRow from Codecharge, to recover CLOB.

Method: public Object get(Object key)

    public Object get(Object key) {  
        Object value = null;  
        if ( (key instanceof String) && useUpperCase ) {  
            value = super.get( ((String) key).toUpperCase() );  
		    /**Begin Custom Change ****/  
		   if (super.get(key) instanceof java.sql.Clob){  
		           java.sql.Clob clob = (java.sql.Clob)super.get(key);  
				   try{  is = clob.getAsciiStream();  
						byte[] buffer = new byte[4096]; outputStream = new;  
						while (true) {  
						    int read =;  
						    if (read == -1) {  
						    outputStream.write(buffer, 0, read);  
						value = outputStream.toString();  
                    }catch( io_ex){  
					    com.codecharge.util.CCLogger.getInstance().error("IOException recover CLOB", io_ex);  
					}catch(java.sql.SQLException sql_ex){  
					    com.codecharge.util.CCLogger.getInstance().error("SQLException recoverCLOB", sql_ex);  
		   /**End Custom Change**/  
        } else {  
            value = super.get( key );  
        return value;  

Matheus Trevizan

Dynamix Software Ltda.
Blumenau SC Brasil
View profile  Send private message

Posts: 35
Posted: 08/29/2007, 8:09 AM


Works great!! Thank you.

I really appreciate your help.

View profile  Send private message

Add new topic Subscribe to topic   

These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

Home   |    Search   |    Members   |    Register   |    Login

Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by  and YesSoftware, Inc.