Are you trying to pass the connection Object to the subreport?
Ideally if you are using subreports in Jasper,
you should get all your data in a collection and then pass all the data to main report which again can pass the data to sub report.
This is the way I have done the Jasper report.