The difference between Statement and PreparedStatement

relationship:

PreparedStatement inherits from Statement, both are interfaces

the difference:

PreparedStatement can use placeholders and is precompiled. Batch processing is more efficient than Statement.
PreparedStatement can prevent SQL injection, but Statement cannot prevent SQL injection.

Guess you like

Origin blog.csdn.net/weixin_44371237/article/details/113758395