
February 28th, 2002, 05:14 PM
|
|
Java Developer
|
|
Join Date: Nov 2001
Posts: 5
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
The idea with a prepared statement is that you can set the query but vary the parameters you pass in. With a statement you have to prepare it dynamically each time. So if for example you wanted a page to insert the content of a form into the db each time it is called then it would be far easier to declare a preparedstatement once and the fill it with the relevant data, than to instatiate a new one each time. Instantiation is an expensive (in terms of time) operation, so multiple instantiation vs a single preparedstatement would be a lot faster.
The next step along is to create callablestatments and get them to call database stored procedures which will be faster as they will be precompiled in the database, and have far more flexibility aswell
Was that any help?
Oscagne
|