precompile « JDBC « Java Database Q&A





1. pre-compile and prepared statement    coderanch.com

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 ...

2. PreparedStatement Pre-compiled Once?    coderanch.com

3. does OracleDriver really precompile a PreparedStatement?    coderanch.com

The 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 ...