1
在我的项目中,我必须根据传递的表创建插入语句。 所以,我有两个选择 1)写PreparedStatement和批量 2运行)插入到创建表值(..)(..)(..)Matcher.quoteReplacement versus preparedstatement
我想知道原因,更喜欢(1)在(2)如果我使用Matcher.quoteReplacement()逃离值提前
感谢
在我的项目中,我必须根据传递的表创建插入语句。 所以,我有两个选择 1)写PreparedStatement和批量 2运行)插入到创建表值(..)(..)(..)Matcher.quoteReplacement versus preparedstatement
我想知道原因,更喜欢(1)在(2)如果我使用Matcher.quoteReplacement()逃离值提前
感谢
Matcher.quoteReplacement
无意引用SQL字符串,所以你无法确定,以避免SQL插入使用它。但是,即使你有一个工作引用功能,准备语句仍然是更好的有以下几个原因: