Re: [PERFORM] How to speed-up inserts with jdbc

2004-11-11 Thread Edwin Eyan Moragas
On Wed, 10 Nov 2004 14:51:57 +0100, Michael Kleiser [EMAIL PROTECTED] 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; i100; ++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.

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faqs/FAQ.html


Re: [PERFORM] How to speed-up inserts with jdbc

2004-11-11 Thread Edwin Eyan Moragas
On Thu, 11 Nov 2004 11:04:18 +0100, Steinar H. Gunderson
[EMAIL PROTECTED] wrote:
 You don't even need a BEGIN and END; his code has a setAutoComit(true)
 before the for loop, which just has to be changed to setAutoCommit(false)
 (and add an explicit commit() after the for loop, of course).

amen. i stand corrected.

-eem

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [PERFORM] Web server to Database Taking forever

2004-09-30 Thread Edwin Eyan Moragas
On Thu, 30 Sep 2004 14:58:27 -0400, Scott Dunn [EMAIL PROTECTED] wrote:
 It is all working now.  The thing is I didn't change anything.  So do you
 still think its Tomcat or the jdbc driver?
 

a suspect might be the nature of JSP. on the first hit,
JSP is converted to a Servlet, the compiled and loaded
by Tomcat. consequent hits would be fast. first one is always
slow.

how did you connect to the database?
-- 
stp,
eyan

inhale... inhale... hold... expectorate!

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send unregister YourEmailAddressHere to [EMAIL PROTECTED])