Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V9taR-0003cV-4K for pgsql-jdbc@arkaria.postgresql.org; Thu, 15 Aug 2013 09:11:19 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1V9taQ-0004zo-FR for pgsql-jdbc@arkaria.postgresql.org; Thu, 15 Aug 2013 09:11:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V9taO-0004zi-1d for pgsql-jdbc@postgresql.org; Thu, 15 Aug 2013 09:11:17 +0000 Received: from [58.58.27.50] (helo=comp.highgo.com.cn) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V9ta9-0008MD-B6 for pgsql-jdbc@postgresql.org; Thu, 15 Aug 2013 09:11:14 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by comp.highgo.com.cn (Postfix) with ESMTP id 970E56D88518 for ; Thu, 15 Aug 2013 17:10:49 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=highgo.com.cn; h= content-type:content-type:message-id:mime-version:x-mailer :subject:subject:reply-to:to:from:from:date:date; s=dkim; t= 1376557849; x=1377421849; bh=acpEASC5FnFg7c20NAQxTrJIfhsH/dy11pf KHWEMLeM=; b=zzKu8KHfBN01cBldy1U8b9udGFjqd8V7NZrMHJB/ZoF1IL5jbOD eeR2YV9xnIjT2C9RAsa3fNoBq6aBwYnNWkI35HOI5wsYim9TMUJ7qNnvzxeVm4ns M3FFQMAAcw1HV/H3om+0xzH8k6N0uSmTD+eK8/RzRKGphaybSRExEpMY= X-Virus-Scanned: amavisd-new at comp.highgo.com.cn Received: from comp.highgo.com.cn ([127.0.0.1]) by localhost (comp.highgo.com.cn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OeHnlOJbE6xj for ; Thu, 15 Aug 2013 17:10:49 +0800 (CST) Received: from Jasmine-PC (unknown [58.58.27.50]) by comp.highgo.com.cn (Postfix) with ESMTPA id 07D2B6D88517; Thu, 15 Aug 2013 17:10:36 +0800 (CST) Date: Thu, 15 Aug 2013 17:10:32 +0800 From: liuyuanyuan To: dmp , polobo Cc: pgsql-jdbc Reply-To: liuyuanyuan Subject: Re: How to insert huge string from file to text field via JDBC ? X-Priority: 3 X-Has-Attach: no X-Mailer: Foxmail 7.0.1.90[cn] Mime-Version: 1.0 Message-ID: <201308151710325164948@highgo.com.cn> Content-Type: multipart/alternative; boundary="----=_001_NextPart350641141805_=----" X-Host-Lookup-Failed: Reverse DNS lookup failed for 58.58.27.50 (failed) X-Pg-Spam-Score: 3.4 (+++) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org This is a multi-part message in MIME format. ------=_001_NextPart350641141805_=---- Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: base64 ICAgICAgICBUaGFua3Mgb2YgYWxsICEgDQogICAgICBZZXMsIHRoaXMgaXMgdW51c3VhbC4gQnV0 IHNpbmNlIGEgdGV4dCBmaWVsZCBjb3VsZCBzdG9yZQ0KdXAgdG8gMkdCICwgdGhlbiBJIHRoaW5r ICB0aGVyZSBtdXN0IGJlIGEgd2F5IHRvIGluc2VydCB2YWx1ZXMgdXAgdG8gMkcNCmluIEpEQkMu IEkga25vdyBhYm91dCBMYXJnZSBPYmplY3QgYW5kIGJ5dGVhLCBhbmQgSSBqdXN0IHRlc3QgdGV4 dA0KZGF0YXR5cGUgYW5kIHdhbnQgdG8gZ2V0IGEgZXhhY3QgcmVzdWx0IGFib3V0IHdoZXRoZXIg d2UgY2FuIGluc2VydCANCmxvbmcgc3RyaW5nIGZyb20gaHVnZSBmaWxlIGludG8gdGV4dCBmaWVs ZCBvciB3aHN0J3MgdGhlICBtYXhpbXVtIHNpemUuDQogICAgIEhvcGUgdG8gZ2V0IG1vcmUgaWRl YXMgZnJvbSB5b3UuDQogDQogQmVzdCBSZWdhcmRzISANCiBZb3VycywNCiBMaXUgWXVhbnl1YW4N Cg0KZGFuYXAgd3JvdGU6DQo+SSBoYXZlIG5vdCB0cmllZCB3aXRoIHRoYXQgc2l6ZSBvZiBkb2N1 bWVudCwgYnV0IHVzaW5nIGEgc3RhbmRhcmQNCj5JbnB1dFJlYWRlciBzZWVtcyB0byB3b3JrIGZp bmUuIEp1c3Qgc2V0dXAgYSBGaWxlUmVhZGVyLCBidWZmZXINCj5pbnRvIGEgU3RyaW5nQnVmZmVy IHRoZW4gd2hlbiBmaW5pc2hlZCB1c2UgdGhlIHN0cmluZ0J1ZmZlci50b1N0cmluZygpDQo+aW4g dGhlIHByZXBhcmVkU3RhdGVtZW50Lg0KDQpsaXV5dWFueXVhbiB3cm90ZToNCj4gSGksDQo+ICAg ICAgTm93IEkgbmVlZCB0byBpbnNlcnQgYSBodWdlIHN0cmluZyBmcm9tIGEgaHVnZSBmaWxlIChl LmcuIGEgMSBHQiB0ZXh0IGRvY3VtZW50KSB0byAgYSBURVhUIHR5cGUgZmllbGQuDQo+ICAgICAg QnV0IEkgZG9uJ3Qga25vdyBhbnkgb3RoZXIgd2F5IHRvIGluc2VydCBzdHJpbmcgZXhjZXB0IHNl dFN0cmluZygpIGZvciBwcmVwYXJlZFN0YXRlbWVudC4NCj4gICAgICBBbnlvbmUga25vdyBhYm91 dCB0aGlzLCBwbGVhc2Ugd3JpdGUgdG8gbWUuIFRoYW5rcyBpbiBhZHZhbmNlIQ== ------=_001_NextPart350641141805_=---- Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable
        Thanks of all !
      Yes, this is unusual. But since a= text=20 field could store
up to 2GB , then I think  there must be a way to insert values u= p to=20 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 <= /DIV>
long string from huge file into text field or whst's the  maximu= m=20 size.
     Hope to get more ideas from you.
 
 Best Regards! 
 Yours,
 Liu Yuanyuan
 
danap wrote:
>I have not tried with that size&nbs= p;of document, but using a standard
>InputReader seems to work fine. Just&nbs= p;setup a FileReader, buffer
>into a StringBuffer then when finished&n= bsp;use the stringBuffer.toString()
>in the preparedStatement.
 
liuyuanyuan wrote:
> Hi,
>      Now I need to&= nbsp;insert a huge string from a huge f= ile (e.g. a 1 GB text document) to = ; a TEXT type field.
>      But I don't kn= ow any other way to insert string excep= t setString() for preparedStatement.
>      Anyone know about&n= bsp;this, please write to me. Thanks in = ;advance!
 
 
 
------=_001_NextPart350641141805_=------