reset database if database is closed in scheduleHandler

cause : use console to open database, ^quit to exit. Database connection lost. Then update record in class oschedule will fail. 

solution : 
Check if database connection is lost or not before update oschedule class, if yes, reset with lastest database connection.