test write data to DB