Test database connection and initialize database when system start