I'm having trouble with treetableview & jfoenix, and I've noticed that in my controller, it is not accepting Tournoi
as type
private JFXTreeTableView<Tournoi> Ttab;
I'm trying to retrieve data from the database and put the data into a treetableview, but I am getting compilation errors. Here is a class I'm using to access the database:
public class Tournoi {
private int id_tournoi;
private String nom;
private Date strat_date;
private Date end_date ;
private int reward1 ;
private int reward2;
private int reward3;
private int prix_par_joueur;
private int nbr_joueur;
private int etat;
private int id_compte;
public Tournoi(int id_tournoi, String nom, Date strat_date, Date end_date, int reward1, int reward2, int reward3, int prix_par_joueur, int nbr_joueur, int etat, int id_compte) {
this.id_tournoi = id_tournoi;
this.nom = nom;
this.strat_date = strat_date;
this.end_date = end_date;
this.reward1 = reward1;
this.reward2 = reward2;
this.reward3 = reward3;
this.prix_par_joueur = prix_par_joueur;
this.nbr_joueur = nbr_joueur;
this.etat = etat;
this.id_compte = id_compte;
}
public void addTournoi(Tournoi t) {
String req = "INSERT INTO `tournoi` ( `nom`, `start_date`, `end_date`, `reward1`, `reward2`, `reward3`, `prix_par_joueur`, `nbr_joueur`, `etat`, `id_compte`) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);";
try {
ps = connection.prepareStatement(req);
ps.setString(1, t.getNom());
ps.setDate(2, (Date) t.getStrat_date());
ps.setDate(3, (Date) t.getEnd_date());
ps.setInt(4, t.getReward1());
ps.setInt(5, t.getReward2());
ps.setInt(6, t.getReward3());
ps.setInt(7, t.getPrix_par_joueur());
ps.setInt(8, t.getNbr_joueur());
ps.setInt(9, t.getEtat());
ps.setInt(10, t.getId_compte());
ps.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
}
}
What could be the source of the problem?