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

From: dmp <danap(at)ttc-cmc(dot)net>
To: liuyuanyuan <liuyuanyuan(at)highgo(dot)com(dot)cn>, PostgreSQL JDBC <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: How to insert huge string from file to text field via JDBC ?
Date: 2013-08-14 13:55:39
Message-ID: 520B8C5B.5000501@ttc-cmc.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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.

danap.

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!
>
> Best Wish!
>
> Yours,
> Liu Yuanyuan
> August 14,2013
> --------------
> 刘媛媛
> 山东瀚高基础软件股份有限公司
> 研发中心
> QQ:73129616

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message David Johnston 2013-08-14 16:20:03 Re: How to insert huge string from file to text field via JDBC ?
Previous Message liuyuanyuan 2013-08-14 09:29:50 How to insert huge string from file to text field via JDBC ?