  We give a connection formula for the Jackson integral of Riemann-Papperitz
type. This includes a solution of the connection problem for the variant of
$q$-hypergeometric equation of degree three introduced by
Hatano-Matsunawa-Sato-Takemura. Using this formula we show a linear relation
for the Kajihara's $q$-hypergeometric series $W^{M,2}$, whose $q$-difference
equation is recently obtained by one of the author.
