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
I have the following query:
connection.prepareStatement("SELECT * FROM (SELECT ?)")
This throws a "JdbcSQLNonTransientException: Unknown data type" exception as it
needs to know the types of the temporary table.
This works:
"SELECT ?"
The parameter doesn't have a type in this case either.