PreparedStatements make sense only in the DB Servers which supports SQL with bind variables. The compiled query is stored in the DB Cache and not in the middle tier. Prepared statements must be just calling the underlying methods to - Parse the query string into a cursor variable - bind the variables (extra step when compared to Statement) - execute the query - close the cursor.
and they don't maintain any metadata about the SQL. Moreover it doesn't make sense to have DB internal structure details in the Java Objects.
Joined: Aug 30, 2004
Thanks Jeanne & Purushothaman
subject: In PreparedStatement how it is detected that query has been changed?