Man accused of shooting officer in court