From: liuyuanyuan <liuyuanyuan@highgo.com.cn>
To: dmp <danap@ttc-cmc.net>
To: polobo <polobo@yahoo.com>
Cc: pgsql-jdbc <pgsql-jdbc@postgresql.org>
Subject: Re: How to insert huge string from file to text field via JDBC ?
Date: Thu, 15 Aug 2013 17:10:32 +0800
Message-ID: <201308151710325164948@highgo.com.cn> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>
Thanks of all !
Yes, this is unusual. But since a text field could store
up to 2GB , then I think there must be a way to insert values up to 2G
in JDBC. I know about Large Object and bytea, and I just test text
datatype and want to get a exact result about whether we can insert
long string from huge file into text field or whst's the maximum size.
Hope to get more ideas from you.
Best Regards!
Yours,
Liu Yuanyuan
danap wrote:
>I have not tried with that size of document, but using a standard
>InputReader seems to work fine. Just setup a FileReader, buffer
>into a StringBuffer then when finished use the stringBuffer.toString()
>in the preparedStatement.
liuyuanyuan wrote:
> Hi,
> Now I need to insert a huge string from a huge file (e.g. a 1 GB text document) to a TEXT type field.
> But I don't know any other way to insert string except setString() for preparedStatement.
> Anyone know about this, please write to me. Thanks in advance!
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: liuyuanyuan@highgo.com.cn, danap@ttc-cmc.net, polobo@yahoo.com
Subject: Re: How to insert huge string from file to text field via JDBC ?
In-Reply-To: <201308151710325164948@highgo.com.cn>
References: <201308151710325164948@highgo.com.cn>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox