pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Edwin Eyan Moragas <haaktu@gmail.com>
To: mkl@webde-ag.de
Cc: Jeff <threshar@torgo.978.org>
Cc: Shane|SkinnyCorp <shanew@skinnycorp.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: How to speed-up inserts with jdbc
Date: Thu, 11 Nov 2004 16:04:06 +0800
Message-ID: <376dd19504111100044aa0ca1e@mail.gmail.com> (raw)
In-Reply-To: <41921CFD.7060604@webde-ag.de>
References: <003201c4c68e$8d347ee0$a702a8c0@shanepc>
	<FF2CC26B-3318-11D9-9406-000D9366F0C4@torgo.978.org>
	<41921CFD.7060604@webde-ag.de>

On Wed, 10 Nov 2004 14:51:57 +0100, Michael Kleiser <mkl@webde-ag.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.



view thread (7+ messages)  latest in thread

Message-ID: <376dd19504111100044aa0ca1e@mail.gmail.com>
Permalink:  ../376dd19504111100044aa0ca1e@mail.gmail.com/
Also on:    postgresql.org/message-id/376dd19504111100044aa0ca1e@mail.gmail.com

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: haaktu@gmail.com, mkl@webde-ag.de, threshar@torgo.978.org, shanew@skinnycorp.com
  Subject: Re: How to speed-up inserts with jdbc
  In-Reply-To: <376dd19504111100044aa0ca1e@mail.gmail.com>

* 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