Move getLastQuery Method to abstract class
Bugfix for pg db driver