statement 和 prepared statement?

2018-07-03 17:40 更新

Statement每次执行sql语句,数据库都要执行sql语句的编译. 最好用于仅执行一次查询并返回结果的情形,效率高于PreparedStatement.

Prepared statements offer better performance, as they are pre-compiled. Use when you plan to use the SQL statements many times.

Prepared statements are more secure because they use bind variables, which can prevent SQL injection attack.

以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号