Adding database code for check database connection feature.