implementing mysql USE database query, refactoring QueryResult