Hello.
H2 compiles your query immediately, so it needs to know the data types of some arguments.
The usual workaround is to wrap the parameter into CAST function. This function doesn't need to know the type of its argument.
SELECT * FROM (SELECT CAST(? AS INT))
Of course, you need to know the data types of such parameters.