1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| private JButton getJButton41() {
if (jButton41 == null) {
jButton41 = new JButton();
jButton41.setText("Libération");
jButton41.setBounds(new Rectangle(774, 88, 128, 47));
jButton41.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
try {
String driverName = "oracle.jdbc.driver.OracleDriver";
Connection connection = null;
String serverName = "10.133.0.25";
String portNumber = "1521";
String sid = "fin";
String url = "jdbc:oracle:thin:@" + serverName + ":" + portNumber +":" + sid;
String username = "DEV";
String password = "MUSU";
Connection connection1 = DriverManager.getConnection(url, username, password);
Statement instruction = connection1.createStatement();
JasperDesign jasperDesign = JRXmlLoader.load("./SRC/IMAGE/libération.jrxml");
JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
Map parameters = new HashMap();
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, connection);
JasperViewer.viewReport(jasperPrint,false);
}
catch (Exception ex) {
System.out.println("erreur "+ex.getMessage());
ex.printStackTrace() ;
}
}
});
}
return jButton41;
} |
Partager