java/db: Fixed prepared statement cache handling.

It's now reset when we connect.