All SQL statements that are sent to the database whether through
JDBC or any other mechanism always go through 2 stages:
i) Prepare - Check that the SQL syntax is valid and work out an execution plan for SQL statement (i.e. sort out which indexes, tables etc are going to be used)
ii) Execute - Actually apply the SQL statement to the database to perform the update, insert, delete or selection.
The time taken on each of these steps will obviously depend on the SQL statement and the database being accessed however the first step can often take a significant amount of time especially if several DB tables are involved. Therefore it makes a lot of sense to ensure that the preparation of the SQL statement is only performed once if you are applying the same SQL statement to multiple records.
Hope this helps
Andy Bowes<br />SCJP, SCWCD<br />I like deadlines, I love the whoosing noise they make as they go flying past - Douglas Adams