java - How to escape string for SQL query (without prepared statement) -
I know the power of the statement, but I can not use it here. I send STL questions via HTTP to external servers, not through JDBC. How to avoid string for SQL query? Is this the way to do it through JDBC? Or should I use a custom class / function for this?
P.s Also I have a connection to another DB, so I can use the JDBC function.
It looks very unsafe. If you are sending a SQL statement over HTTP, you can compromise between the Man-in-the-Middle Assault (among others). In addition, any average level programmer can try to execute malicious SQL instead of your database, if they see that you are sending virtually to SQL statements. They can create users, change passwords, retrieve sensitive data ... are you sure that this is the best way to approach things?
Comments
Post a Comment