[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tomcat-user
Subject:    RE: PreparedStatement w/ Connection Pooling
From:       "George Sexton" <gsexton () mhsoftware ! com>
Date:       2006-01-14 1:14:03
Message-ID: 20060114011404.362B464D22 () mail ! mhsoftware ! com
[Download RAW message or body]


> -----Original Message-----
> From: Khawaja Shams [mailto:ksshams@gmail.com] 
> Sent: Friday, January 13, 2006 2:44 PM
> To: Tomcat Users List
> Subject: Re: PreparedStatement w/ Connection Pooling
> 
> Hello,
>      Benchmarking is precisely what I am trying to do.  However, if I
> prepare a statement every time I need to execute the 
> statement, it would not
> be an accurate measurement of optimizations that 
> preparedStatements can
> offer.  In fact, this would probably be worse than just executing the
> statement once and for all.  This is why I am wondering if 
> this is possible

It would be pretty simple to get a prepared statement object and call it in
a loop as many times as necessary to get a benchmark.

> so I can test for performance before integrating this with 
> our solution.
> PreparedStatement can POTENTIALLY offer a great deal of 
> optimizations, if
> used PROPERLY.

Lots of ifs. If the database supports it, if your application uses
statements that would benefit a lot. Unless you are in a pretty tight loop,
its probably not going tomater. If it really helps your database.



>      Also, from what I have read so far, pre compiled 
> statements do a very
> nice job of preventing SQL Injections.  I am certainly open to hearing
> better suggestions from you.  Although you sound like a 
> manager, kindly note
> that I am not your employee.

I'm quite certain you are not my employee as well. I am a developer
(professional for something like 15 years now). I have managed a lot of
projects.
 


George Sexton
MH Software, Inc.
http://www.mhsoftware.com/
Voice: 303 438 9585
  


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic