>
> My question now is, should I even bother using a PrepearedStatement
> for the case in hand? A 'Statement' could produce the same results.
> Or is it better practice to use PreparedStatements(i.e benefits of a
> precomipled SQL statement, greater functionality should I choose to
> enhance my code)???
Certainly I think it's good practice to use parameter markers in a
PreparedStatement. Don't underestimate the importance in precompiling
SQL, especially in a dynamic web environment.
For instance in DB2 UDB, there is a cache of dynamic SQL statements.
DB2 is a very compile heavy system - every query is "compiled" into an
"executable" access plan which is interpreted by the runtime. In a web
environment when you have a small number of queries which keep hitting
the database server you can gain an enormous amount of performance by
having the system exploit the cache. The precompiled query will be
executed right away. If you don't use a parameter marker and instead
construct each SQL statement separately, the database engine will end
up compiling each query every time. For db servers which are not smart
enough to do this it may not make much of a difference.
=====
Pip-Pip
Sailesh
Ph: (408) 225-8035 [H]
(408) 463-3176 [W]
Fax: (208) 730-7889
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html