Re: How to insert huge string from file to text field via JDBC ?

From: liuyuanyuan <liuyuanyuan(at)highgo(dot)com(dot)cn>
To: dmp <danap(at)ttc-cmc(dot)net>, polobo <polobo(at)yahoo(dot)com>
Cc: pgsql-jdbc <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: How to insert huge string from file to text field via JDBC ?
Date: 2013-08-15 09:10:32
Message-ID: 201308151710325164948@highgo.com.cn
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-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!

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2013-08-15 20:16:06 test sending to list
Previous Message Andreas Rudolph 2013-08-15 07:07:06 Re: BUG org.postgresql.Driver.connect() distorts InterruptedException