  The connection problem associated with a Selberg type integral is solved. The
connection coefficients are given in terms of the $q$-Racah polynomials. As an
application of the explicit expression of the connection coefficients, examples
of the monodromy-invariant Hermitian form of non-diagonal type are presented.
It is noteworthy that such Hermitian forms are intimately related with the
correlation functions of non-diagonal type in $\hat{sl_2}$-confromal field
theory.
