Ebean – Dynamic Query – Prepared Statement’s Mismatched Parameter Count Error

I’ve seen something similar (on DB2) using prepared statements. Querties only worked for the number of parameters the first statement executed had. Only the number of parameters it had the first time it was invoked or less would work. It probably set aside a buffer for the parameters – I believe it acted like the extra parameters did not exist.

If the first call had enough parameters then everything would be fine until you hit more than that number of parameters. But the next run might fail immediately if the first query only had 1 parameter and the next call had more than one.

Check if it works with a regular statement instead of a prepared statement. If so suspect an error in prepared statements handling for variable numbers of parameters.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)