There exist the polynomial solutions of the differential equation of order 2 under the condition $a^2+d^2 \neq 0$ . They are classified into 4 cases. For each case, we classify the orthogonal polynomial sequence and the weak orthogonal polynomial sequence, respectively. Also, we give 6 types of the Bochner-Krall orthogonal polynomial sequence.