예제 #1
0
 public static void MAJCoordonnees() throws IOException {
   compteur = 0;
   DatabaseConnect BDD = new DatabaseConnect();
   BDD.Connexion();
   BDD.ViderTable("tb_stopscoordon");
   fis = new FileInputStream("res/coordonnees.csv");
   br = new BufferedReader(new InputStreamReader(fis, Charset.forName("UTF-8")));
   System.out.println(
       "Mise a jour de la table <tb_stopscoordon> en cours...\nVeuillez patienter...");
   while ((line = br.readLine()) != null) {
     String array[] = pattern.split(line, 0);
     if (array.length == 3) {
       try {
         BDD.Ajouter(
             "INSERT INTO tb_stopscoordon VALUES ("
                 + array[0]
                 + ","
                 + array[1]
                 + ","
                 + array[2]
                 + ")");
         compteur++;
       } catch (Exception err) {
       }
     }
   }
   System.out.println("Mise a jour terminee.\n" + compteur + " lignes ont ete ajoutees.");
   BDD.Deconnexion();
 }