How to use Question Mark (?) string literal for JDBC connection?

Confluence User - 27 Aug, 2018

Hi,

I'm placing a hyperlink in the form grid using JDBC binder. If I use the question mark in the string, it throws a java error (presumably because ? is a variable for the preparedstatement).  How can I use the '?' in JDBC binder? Thanks. See yellow highlight below.

forms;jdbc;formgrid

3


27 Aug, 2018
confluenceUser
confluenceUser

Hey Voon Lok,

Very good question indeed!

I will pass this request to the team to handle this matter.

I will get back to you here once this suggestion has been implemented.

Best regards.

28 Aug, 2018
confluenceUser
confluenceUser

I found that you have to use CHAR(63 using ASCII) instead of ?

 

(smile)

28 Aug, 2018
confluenceUser
1
confluenceUser

Good find, Voon Lok :)

According to this link --> https://stackoverflow.com/questions/26516204/how-do-i-escape-a-literal-question-mark-in-a-jdbc-prepared-statement
Except for PostgreSQL where question marks are escaped with double question marks (??), usually other databases does not require any additional steps to escape a question mark in a literal string.
Hope this clarifies.

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print