Class Database: Error while executing Query