db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oystein Grovlen - Sun Norway <Oystein.Grov...@Sun.COM>
Subject Re: Store very large Strings
Date Fri, 13 Apr 2007 13:56:33 GMT
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.

-- 
Øystein

Mime
View raw message