1. pre-compile and prepared statement coderanch.comAll 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 ... |
2. PreparedStatement Pre-compiled Once? coderanch.com |
3. does OracleDriver really precompile a PreparedStatement? coderanch.comThe driver does not compile any sql. The database does. Your query will get compiled at first use. The advantage of PreparedStatement is, that your database knows you're using the same query the second time, even when you use different values for your parameters. If you use a Statement, Oracle will compile the query again if you change the where clause ... |