ajout fonction API
This commit is contained in:
@@ -27,11 +27,11 @@ public class Graphic{
|
||||
this.fenetre.setSize(1000, 720);
|
||||
this.fenetre.setLocation(200,200);
|
||||
this.fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
agf=this.getPromo();
|
||||
this.getPromo();
|
||||
this.fenetre.setVisible(true);
|
||||
}
|
||||
|
||||
private AbstractGroupeFactory getPromo(){
|
||||
private void getPromo(){
|
||||
this.agf=null;
|
||||
try{
|
||||
Class.forName("org.mariadb.jdbc.Driver");
|
||||
@@ -76,9 +76,38 @@ public class Graphic{
|
||||
}catch(ClassNotFoundException e){
|
||||
System.out.println("pilote non disponible");
|
||||
}
|
||||
return factory;
|
||||
}
|
||||
private void addSousGroupe(Groupe g){
|
||||
|
||||
try{
|
||||
Class.forName("org.mariadb.jdbc.Driver");
|
||||
try{
|
||||
Connection cnx = DriverManager.getConnection(
|
||||
"jdbc:mariadb://dwarves.iut-fbleau.fr/chaignea",
|
||||
"chaignea", "Chaigneauphpmyadmin");
|
||||
try{
|
||||
PreparedStatement pst = cnx.prepareStatement(
|
||||
"SELECT `id`, `nom`, `min`, `max`, `value`, `id-parent` FROM `Groupe` join `TYPE` on Groupe.Type=TYPE.name where Groupe.`id-parent`=?; ");
|
||||
try{
|
||||
|
||||
try{
|
||||
|
||||
}catch(SQLException e){
|
||||
System.out.println("erreur dans la prise de resultat");
|
||||
}
|
||||
rs.close();
|
||||
}catch(SQLException e){
|
||||
System.out.println("erreur dans le resultat");
|
||||
}
|
||||
pst.close();
|
||||
}catch(SQLException e){
|
||||
System.out.println("erreur dans la preparation");
|
||||
}
|
||||
cnx.close();
|
||||
}catch(SQLException e){
|
||||
System.out.println("Erreur dans la connexion!");
|
||||
}
|
||||
}catch(ClassNotFoundException e){
|
||||
System.out.println("pilote non disponible");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user