adapter disconnects

How do you handle reconnecting adapters that lose their connection to databases that go down nightly for maintenance or just go down because of system problems?