I guess the database is on your network, on a server.
Quote:
I want to Update database if network cable is unplug , I caanot understand how to manage this .
Simple, you don't.
You communicate between you PC and the server by the network cables, When you unplug the cable, you cut the link. No program can replug the cable. your app will abend with a faillure to communicate with the server, no matter what.
All the things you can do is replug the cable in hope the app is still awaiting an answer and have not timed out.