Re: How to speed-up inserts with jdbc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux