jpstats :: add derby and mysql compliant queries

Hi there, 
I've added derby and mysql compliant queries for jpstats.