How to capture/encode special character for SQL Server in java app? -
I have Java app + SQL Server database DB operation uses JDBC with dynamic SQL string. Example:
Select the column from the tab where the column = stringperm
is the StringParam user input. If the string parm contains the apostost, then the Java app will throw exceptions and say SQL can not be executed.
Never insert a user directly into an SQL query You must use the prepared space. Without changing the Java code, I do not see any way to make it secure.
Comments
Post a Comment