Skip to content
Advertisement

how to set concatenated string parameter in preparedstatement

I have the following java code:

I get the following exception in codeline 3-:

Invalid column index

What did I do wrong? how to set params correctly?

Advertisement

Answer

Take the bind parameters out of the string literal:

Or, create a single bind parameter and pass in the concatenated value:

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement