简单点理解:prepareStatement会形成参数化的查询,例如:

1

select * from A where tablename.id = ?

传入参数'1;select * from B'如果不经过prepareStatement,会形成下面语句:

1

select * from A where tablename.id = 1;select * from B

这样等于两次执行,但如果经过预处理,会是这样:

1

select * from A where tablename.id = '1;select * from B'

'1;select * from B'只是一个参数,不会改变原来的语法

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-27
  • 2021-05-21
  • 2021-09-24
猜你喜欢
  • 2021-07-24
  • 2022-12-23
  • 2021-07-15
  • 2022-01-05
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案