Mysql
 sql >> Datenbank >  >> RDS >> Mysql

PreparedStatement ignoriert Parameter in der Abfrage:java.sql.SQLException:Parameter index out of range (1> number of parameters, was 0)

versuchen Sie dies

String sql = "SELECT * FROM `as` WHERE `as`.ip_range LIKE ?";
PreparedStatement statement = connection.prepareStatement(sql);
statement.setString(1, "%" + clientIP + "%");