public static ArrayList<Carte> getAllCarte() {

        Statement stat;
        ArrayList<Carte> cartes = new ArrayList<>();
        try {
            stat = ConnexionDB.getConnection().createStatement();
            stat.executeUpdate("use nemovelo");
            ResultSet res = stat.executeQuery("select * from carte");
            Carte carte;
            int id_carte;
            String serialNumber;
            while (res.next()) {
                id_carte = res.getInt("id_carte");
                serialNumber = res.getString("serialNumber");
                carte = new Carte(id_carte, serialNumber);
                cartes.add(carte);
            }
        } catch (SQLException e) {
            while (e != null) {
                System.out.println(e.getErrorCode());
                System.out.println(e.getMessage());
                System.out.println(e.getSQLState());
                e.printStackTrace();
                e = e.getNextException();
            }
        }
        return cartes;

    }