load database and apply data