Subject | Re: [Firebird-Java] Insert StringBuffer into BLOB SUB_TYPE 1 |
---|---|
Author | Roman Rokytskyy |
Post date | 2008-01-14T11:37:34Z |
Hi,
data will be kept in memory before the executeUpdate is issued. When you
use streams (InputStream) in non-autocommit mode, it will create BLOB,
pump data into database and keep in memory only the BLOB ID. But
nowadays 1 MB is not that much, so feel free to use setString.
Please note, when using setString, regular charset conversion takes place.
Roman
> is it safe to insert a largish (possibly > 1MB) amount of data from aNo, it is enough to use setString() method. The only consequence is that
> StringBuffer into a BLOB SUB_TYPE 1 field by using the following?
>
> ps.setString(2, xml.toString());
>
> where ps is a PreparedStatement and xml is a StringBuffer? Or do I have
> to use some kind of streaming?
data will be kept in memory before the executeUpdate is issued. When you
use streams (InputStream) in non-autocommit mode, it will create BLOB,
pump data into database and keep in memory only the BLOB ID. But
nowadays 1 MB is not that much, so feel free to use setString.
Please note, when using setString, regular charset conversion takes place.
Roman