Which of the following is efficient than a statement due to the pre-compilation of SQL?

Which of the following is efficient than a statement due to the pre-compilation of SQL?

A - Statement
B - PreparedStatement
C - CallableStatement
D - None of the above.

Answer

 B

Explanation:

PreparedStatement is efficient than the statement due to the pre-compilation of SQL.

PreparedStatement Improves performance: The performance of the application will be faster if you use the PreparedStatement interface because a query is compiled only once.
PreparedStatement interface takes parameters and the advantage of using SQL statements that take parameters is that you can use the same statement and supply it with different values each time you execute it.

Comments