CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Tips & Solutions

 CLOB to string

Print topic Send  topic

Author Message
mfetting

Posts: 8
Posted: 12/31/2005, 9:02 AM

This is my first attempt at solving this problem. This is what I have done that appears to be working.

xxxDataObject.java I made the following change in //loadDataBind:

//commented out the variable that needed to be converted.
//row.setNote(Utils.convertToString(ds.parse(record.get("Note"), row.getNoteField())));
//added the following code.
Clob cl = (Clob) record.get("Note");
if (cl == null) {
row.setNote("");
} else {
StringBuffer strOut = new StringBuffer();
String aux;
try {
BufferedReader br = new BufferedReader(cl.getCharacterStream());
while ((aux=br.readLine())!=null)
strOut.append(aux);
row.setNote(strOut.toString());
} catch (java.sql.SQLException e1) {
row.setNote(e1.toString());
} catch (java.io.IOException e2) {
row.setNote(e2.toString());
}
}

This is work in progress. I would recommend you save this code block in a seperate file for save keeping.
View profile  Send private message
mfetting

Posts: 8
Posted: 12/31/2005, 9:57 AM

The following imports will be needed for this solution.

import java.io.*;
import java.sql.Clob;
View profile  Send private message
Jacob Svendsen
Posted: 02/09/2006, 6:23 AM

Thanks for showing the world this solution! It really helped me in my work with Clobs/ClobDomain :-)
TIMON
Posted: 02/10/2006, 8:56 AM

error capture no Clob cl = (Clob) record.get("Note");
yes capture Clob cl = record.getClob("Note");

t_coy01
Posted: 04/04/2006, 6:44 PM

I have problem with this?
" row.setNote(""); "

Please help....


tnx in advance O:)
mfetting

Posts: 8
Posted: 04/04/2006, 7:23 PM

setNote is a setter for note.

In my case the item was note, you may be retrieving something other than note.

I'm unable to tell you what you need to do with the limited description of the problem your experiencing. I hope this helped in some small way.
View profile  Send private message
Deepak
Posted: 05/24/2006, 10:28 PM

I am getting problem while writting a proc to convert Clob to Xml,
and Clob to String

ORA-06512: at "SYS.DBMS_XMLGEN", line 83
mfetting

Posts: 8
Posted: 05/25/2006, 6:51 AM

Try the following goole search

SYS.DBMS_XMLGEN "line 83"

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 http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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