Added private method QueryDB to be used in SELECT, UPDATE, and DELETE operations