Statement against prepared statement in terms of precompilation

I understand the main difference between using Statement and PreparedStatement (PreparedStatements allows passing parameters). But I read about the subtle difference between the two, namely that PreparedStatements can be faster than general statements, because PreparedStatement SQL is precompiled.

What exactly does precompilation mean, and why does it matter?

+5
source share
2 answers

A trained operator performs the following checks:

  • Verify that tables and columns exist.
  • Make sure parameter types match their columns
  • Parses SQL to verify that the syntax is correct.
  • SQL, .
+8

.

, , , (, , , // ..). , , , (, , , ..).

, , . ? , where , , , , .

. , , . . , , .

, , , (, ), . ( , , ).

, , , (, ), .

, , . PreparedStatements , .

+4

All Articles