Escaping SQL Strings in Java

后端 未结 3 1191
一生所求
一生所求 2021-01-18 11:03

Background:

I am currently developing a Java front end for an Enterprise CMS database (Business Objects). At the moment, I am building a feature to

3条回答
  •  北荒
    北荒 (楼主)
    2021-01-18 11:29

    You may still be able to used a prepared statement. See this post: get query from java sql preparedstatement. Also, based on that post, you may be able to use Log4JDBC to handle this.

    Either of these options should prevent you from needing to worry about escaping strings to prevent SQL injection, since the prepared statement does it for you.

提交回复
热议问题