I am assuming that you are using the community jdbc output plugin. That is not supported by Elastic and the author no longer maintains it, so there is nobody you can go to for support.
My reading of the code that adds parameters to the statement is that either version of your statement option should work. I do not know what to suggest.