Unfortunately not. Positional parameters ('?') - this is exactly what is determined by their position or the order in which they appear in the request. If you remove the IDFOLDER =? Identifier, you will assign incorrect parameters to the rest of the request and possibly get an exception, since the number of assigned parameters does not match the number expected in the request.
I assume that you cannot change the source code, since this is the easiest route - change SQL and then JDBC parameters to match. If you need to use the same number of parameters, you can write a query in such a way as not to change the IDFOLDER value, but use the first parameter.
SET IDFOLDER=CASE ISNULL(?) WHEN 0 THEN IDFOLDER ELSE IDFOLDER END
If your JDBC driver supports named parameters, this may give you a cleaner alternative.
mdma
source share