Can this simple String escaping prevent any SQL Injections?
问题 I'm working at a company where the person responsible for the database module is strictly against using prepared statements. I'm worrying that his implementation is not secure. Here is the code we are currently using to make a SQL query (Java 8 Application with JDBC/MySQL 5.5): String value = "Raw user input over HTTP-Form"; String sql = "SELECT * FROM db1.articles WHERE title like '" + replaceSingleQuotes(value) + "'"; executeSQL(sql); public static String replaceSingleQuotes(String value) {