Named placeholders for SQL #1467
Replies: 3 comments 16 replies
-
Greetings! Yes, this is certainly possible, however I wonder if you are not looking for a more sophisticated approach:
Rationale: this approach allows for using Prepared Statements and Batch Updates yielding in much better performance instead of parsing single statements with hard coded parameters under heavy performance penalty. In a nutshell, you would call a methods:
This is not necessary in Scope of JSQLParser, but rather belongs into a JDBC extension. |
Beta Was this translation helpful? Give feedback.
-
Greetings. A first commit: https://github.com/manticore-projects/MJdbcUtils I will add more stuff over the next couple of days. |
Beta Was this translation helpful? Give feedback.
-
I have pushed support for
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a string representing a SQL statement with placeholders (
:name-of-placeholder
) like:SELECT * FROM table WHERE id = :id AND name = :name AND description LIKE "%:something%"
Is it possible to process it so that I can get each placeholder (
:id
and:name
, but not:something
) and replace each with a value (numeric or string), such that:' OR TRUE'
then ti should escape it correct in order to prevent SQL injection.Beta Was this translation helpful? Give feedback.
All reactions