db connect and insert