Connection con = connection.ConnectionFactory.getConnection();
int confirma = JOptionPane.showConfirmDialog(null, "confirma a impressão do relatorio?","Atenção",JOptionPane.YES_NO_OPTION);
if(confirma == JOptionPane.YES_OPTION){
String src = "C:/Usersivan/Desktop/OrdemServico/teste.jrxml";
JasperPrint jasperPrint = null;
try {
/
jasperPrint = JasperFillManager.fillReport(src, null,con );
} catch (JRException err) {
JOptionPane.showConfirmDialog(rootPane,"erro ao gerar relatorio /n"+ err);
}
JasperViewer view = new JasperViewer(jasperPrint, false);
view.setVisible(true);
}