Re: How to speed-up inserts with jdbc

From: Edwin Eyan Moragas <haaktu(at)gmail(dot)com>
To: mkl(at)webde-ag(dot)de
Cc: Jeff <threshar(at)torgo(dot)978(dot)org>, Shane|SkinnyCorp <shanew(at)skinnycorp(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: How to speed-up inserts with jdbc
Date: 2004-11-11 08:04:06
Message-ID: 376dd19504111100044aa0ca1e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Wed, 10 Nov 2004 14:51:57 +0100, Michael Kleiser <mkl(at)webde-ag(dot)de> wrote:
> Statement st = con.createStatement();
> java.sql.Timestamp datum = new java.sql.Timestamp(new Date().getTime());
> Date start = new Date();
> System.out.println(start);
> for (int i=0; i<100; ++i) {
> st.executeUpdate("insert into history(uuid,coni,date,direction,partner,type) values('uuid','content','"+datum+"','dir','partner','type')");
> }

how about using PreparedStatment? that's on the java end.
on the pg end, maybe do a BEGIN before the for loop and
END at the end of the for loop.
--
i'm not flying. i'm falling... in style.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Steinar H. Gunderson 2004-11-11 10:04:18 Re: How to speed-up inserts with jdbc
Previous Message Gaetano Mendola 2004-11-11 08:03:24 Re: vacuum analyze slows sql query