'Preventing the SQL injection in Statement [closed]

I am working on a legacy project and the project had done the auditing recently. Facing an issue with SQL Injection. The have try to resolve it with StringEscapeUtils.escapeHtml5

String n=StringEscapeUtils.escapeHtml5(request.getParameter("name"))

by writing the above code. The issue hasn't been resolved yet.Is there any process not to change the entry code to preparedstatment?

please help on it



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source