When looking at the mysql logs I was confused: 060727 20:40:45 25 Prepare [2] SELECT DISTINCT t0_c.ID FROM dynamicproperty t0_c WHERE (t0_c.LOOKUP_KEY = ?) 25 Execute [2] SELECT DISTINCT t0_c.ID FROM dynamicproperty t0_c WHERE (t0_c.LOOKUP_KEY = '') Was the parameter missing ? Indeed p6spy seems to indicate that the query is correctly run. 1154025645167|22|0|statement|SELECT DISTINCT t0_c.ID FROM dynamicproperty t0_c WHERE (t0_c.LOOKUP_KEY = ?)|SELECT DISTINCT t0_c.ID FROM dynamicproperty t0_c WHERE (t0_c.LOOKUP_KEY = 'fop.basedir') If I run the query from the command line mysql -u root IMLSYS -e "SELECT DISTINCT t0_c.ID FROM dynamicproperty t0_c WHERE (t0_c.LOOKUP_KEY= 'fop.basedir')" +----+ | ID | +----+ | 5 | +----+ the result is found. Note when I run the query from the command line, mysql logs the query fully: 060727 20:49:17 48 Connect root@localhost on IMLSYS 48 Query SELECT DISTINCT t0_c.ID FROM dynamicproperty t0_c WHERE (t0_c.LOOKUP_KEY= 'fop.basedir') I now think the problem is either in the driver or mysql itself or a configuration issue. I am using mysql connector/j 3.1.13 and mysql 4.1.15-1ubuntu5 as found in ubuntu 6.06. I already tried to use the driver version used in prod: 3.1.4-beta but that didn't help. Next step (for me) is to try an older version of mysql, preferably the one they are using. (I believe 4.1.7 according to their mail). Any idea ?