replace Adapter with database