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

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -