data reading and insert to database