db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruben Fonseca <rubenfons...@di.uminho.pt>
Subject Re: Store very large Strings
Date Fri, 13 Apr 2007 14:07:50 GMT
On Fri, 2007-04-13 at 15:56 +0200, Oystein Grovlen - Sun Norway wrote:
> Ruben Fonseca wrote:
> > Hi to all :)
> > 
> > I'm doing a research project using Java and Apache Derby. It proved to
> > be an excelent combination with a lot of power!
> > 
> > However, I'm having a problem right now. I need to store a very large
> > string (150k - 200k lines) on a field of my database. AFAIK, there are
> > no database types for holding this data.
> > 
> > Do I have to use a BLOB? I think it's a hard work implementing a Blob
> > interface to hold a serialized form of the String class. Do you know any
> > simple working example? Or do you have a better sugestion?
> 
> For Strings you should use the CLOB type. To pass a String for a CLOB 
> parameter in a prepared statement, you can use 
> PreparedStatement.setString or PreparedStatement.setCharacterStream.
> 

Thank you! I didn't know about the CLOB type! However, I'm still having
problems when *reading* from the CLOB.. When I call the
ResultSet.getString on the CLOB I get a IOException thrown, when the
String is large... Is this a known problem?


Mime
View raw message