Check for db connection or connect