When you try to split any string with ? or * as below code.
String sqlParts = sql.split("?");
You will end up with unchecked PatternSyntaxException as given below.
java.util.regex.PatternSyntaxException: Dangling meta character '?' near index 0
Avoid using dangling metacharacters like ‘?’, ‘+’ and ‘*’. Instead use it with escape sequences as like below.
String sqlParts = sql.split("\\?");