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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
|
// INSERTION DU FICHIER DANS LA BASE DE DONNEES
System.out.println("3- INSERTION DU FICHIER DANS LA BASE DE DONNEES");
try {
System.out.println(ift.getCheminInsertion());
System.out.println(ift.importAccess(nomNewTable,
"jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ="
+ ift.getCheminInsertion().replace('\\', '/')));
} catch (OutOfMemoryError e) {
System.out.println("id = 1");
e.printStackTrace();
}
catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}
/* File supprMiseEnForme = new File(ift.getCheminMiseEnForme()); File
* supprInsert = new File(ift.getCheminImport());
*
* supprMiseEnForme.delete(); supprInsert.delete();
*/
// GENERER LE OU LES RAPPORTS A PARTIR DE LA BASE DE DONNEES
System.out
.println("5- GENERER LE OU LES RAPPORTS A PARTIR DE LA BASE DE"
+ " DONNEES");
// GENERATION DES INFORMATIONS
String cheminRapportTxt = res.getString("cheminResourcesUtilisateur");
RapportTxt rTXT = new RapportTxt(cheminRapportTxt
.replace('\\', '/'));
try {
rTXT.setFileName("nb_visite_par_mois");
rTXT.comptageNbVisiteParMois("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ="
+ ift.getCheminInsertion().replace('\\', '/'), nomNewTable);
} catch (OutOfMemoryError e) {
System.out.println("id = 2");
e.printStackTrace();
}
catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
try {
rTXT.setFileName("nb_visite_par_mois_par_service");
rTXT.comptageNbVisiteParMoisParService("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ="
+ ift.getCheminInsertion().replace('\\', '/'), nomNewTable);
} catch (OutOfMemoryError e) {
System.out.println("id = 3");
e.printStackTrace();
}
catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
// GENERATION DES RAPPORTS
String rapport = "";
String cheminRapport = res.getString("cheminRapport");
RapportHtml rHTML = new RapportHtml(cheminRapport
.replace('\\', '/'));
rHTML.setCheminCss(res.getString("cheminCss"));
try {
rHTML.setFileName("nb_visite_site_par_user");
rapport = rHTML.rapportNbConnectParSiteParUser("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ="
+ ift.getCheminInsertion().replace('\\', '/'), nomNewTable, rHTML.getCheminCss());
rHTML.save(rapport);
for (int i = 0; i < cat.size(); i++) {
rHTML.setFileName("nb_visite_site_par_user_pour_le_service_" + cat.get(i));
rapport = rHTML.rapportNbConnectParSiteParService("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ="
+ ift.getCheminInsertion().replace('\\', '/'), nomNewTable, rHTML.getCheminCss(), cat.get(i));
rHTML.save(rapport);
}
rHTML.setFileName("nb_visite_par_site");
rapport = rHTML.rapportNbVisiteParSite("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ="
+ ift.getCheminInsertion().replace('\\', '/'), nomNewTable, rHTML.getCheminCss());
rHTML.save(rapport);
rHTML.setFileName("nb_visites_mensuelles_par_service");
rapport = rHTML.rapportVisitesMensuellesParService(cheminRapportTxt.replace('\\', '/'), "nb_visite_par_mois_par_service.txt");
rHTML.save(rapport);
rHTML.setFileName("nb_visites_mensuelles");
rapport = rHTML.rapportVisitesMensuelles(cheminRapportTxt.replace('\\', '/'), "nb_visite_par_mois.txt");
rHTML.save(rapport);
} catch (OutOfMemoryError e) {
System.out.println("id = 4");
e.printStackTrace();
}
catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("7- FIN DU MAIN"); |
Partager