We provide a criterion for the class group of a complex quadratic field to have exponent at most 2. This is given in terms of the factorization of a generalized Euler-Rabinowitsch polynomial and has consequences for consecutive distinct initial prime-producing quadratic polynomials which we cite as applications.