• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

transform ClobToString, StringToClob with jdk 1.3

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all, guys, I need functions to transform ClobToString and StringToClob, anybody know how do that with jdk 1.3??? thanks in advanced. Mauro
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess that we are just not Clob affectionados around here .
 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
private String getFromCLOB(CLOB clob) throws IOException
{
String sFile = "";
Reader reader = clob.getCharacterStream();
BufferedReader in = new BufferedReader(reader);
String buffer;
StringBuffer output = new StringBuffer();
while (!(null == (buffer = in.readLine())))
{
output.append(buffer);
}
sFile = new String(output);
return sFile;
}
 
Mauro Velasco
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for reply, you know how make a
clobToString ?
tia
Mauro
 
Mauro Velasco
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry stringToClob.

Mauro.
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Oracle JDBC API gives a solution to StringToClob:
Use oracle.sql.CLOB class and it's methods:
1. public java.io.Writer getCharacterOutputStream()throws java.sql.SQLException
Write Unicode stream to the CLOB.
2. public java.io.OutputStream getAsciiOutputStream()throws java.sql.SQLException
Write ascii stream to the CLOB.
 
Mauro Velasco
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, you are right, Oracle CLOB work fine, but I need use only the Java Clob (jdk 1.3.1), the reason is try to create certain independence from the database and use others functions developed on jdk 1.3.1 (iAs by example)
If you know how make this please tell me...
Regards
Mauro
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic