Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Databases > How to use Prep...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 3646 of 3876
Post > Topic >>

How to use PreparedStatements on a servlet the most efficient way?

by mebe <internetsux@[EMAIL PROTECTED] > Feb 7, 2008 at 02:54 AM

Hello,

i wonder whats the most efficient way to create PreparedStatements on
a
servlet. Currently i see the following two options:
1 Creating them in the method at which they are executed. (Seems
obvious)
2 Creating all PreparedStatements in the servlets contructor and store
them
in the servlets class. This way only the parameters must be supplied
if a
PreparedStatement should be executed, and the time to create the
PreparedStatement could be saved.
But is this approach thread save? (What if two identical requests are
issued at the same time? Wouldn't they interfere each other?)

Please let me know if you have any information about this topic.
Thanks in advance!
 




 4 Posts in Topic:
How to use PreparedStatements on a servlet the most efficient wa
mebe <internetsux@[EMA  2008-02-07 02:54:49 
Re: How to use PreparedStatements on a servlet the most efficien
Lew <lew@[EMAIL PROTEC  2008-02-07 09:59:38 
Re: How to use PreparedStatements on a servlet the most efficien
efriedNoSpam@[EMAIL PROTE  2008-02-08 04:28:50 
Re: How to use PreparedStatements on a servlet the most efficien
mebe <internetsux@[EMA  2008-02-07 08:21:54 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Dec 3 22:23:20 CST 2008.