redesigned the DBAdapter class