How do I escape a literal question mark ('?') in a JDBC prepared statement
问题 I'd like to create a JDBC PreparedStatement like: SELECT URL,LOCATE ( '?', URL ) pos FROM Links WHERE pageId=? ORDER BY pos ASC Where the 1st ? is a literal and the 2nd ? is a parameter. I could use CHAR(63) in place of the '?' but I think the extra function call would slow down the SQL execution. Is there some way to escape that 1st ? ? Edit: The following code tests dkatzel's assertion that the ? character in a string is not considered a marker: public class Test { public static void main