wvmarle:
For added interest: now I moved the code that handles the query into a separate function, it suddenly works fine?! I really don't get it.
No idea about MySql connector, no idea about ESP. But this symptom can often be an indication of memory problems. Try without the use of String (capital S).