In this post we have learned about different types of statements in JDBC and why we consider prepared statement is a better option than using statements. But there are some scenarios when Statement can perform better that PreparedStatements. Consider the following example:
Because Prepared Statement objects are pre-compiled, their execution can be faster than that of Statement objects. Consequently, an SQL statement that is executed many times is often created as a Prepared Statement object to increase efficiency. Prepared execution is faster than direct execution for statements executed more than once, primarily because the query is parsed only once. In the case of direct execution, the query is parsed every time it is executed. But first time statement is faster.
So we should use Statement for queries which runs once in a while.