debut MPD
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
package fr.iutfbleau.projetIHM2022FI2.Test;
|
||||
import fr.iutfbleau.projetIHM2022FI2.API.*;
|
||||
import fr.iutfbleau.projetIHM2022FI2.Graphic.View.*;
|
||||
import fr.iutfbleau.projetIHM2022FI2.Graphic.View.MaFenetre;
|
||||
import fr.iutfbleau.projetIHM2022FI2.Graphic.Graphic;
|
||||
import fr.iutfbleau.projetIHM2022FI2.MNP.*;
|
||||
import java.util.*;
|
||||
import org.mariadb.jdbc.*;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Objects;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.ResultSet;
|
||||
|
||||
public class TestTexteMNP{
|
||||
|
||||
@@ -19,8 +26,8 @@ public class TestTexteMNP{
|
||||
|
||||
////System.out.println("Test de l\'API");
|
||||
//System.out.print("Création des étudiants");
|
||||
MaFenetre fenetre=new MaFenetre();
|
||||
fenetre.setVisible(true);
|
||||
Graphic ga=new Graphic();
|
||||
|
||||
Etudiant e1=new EtudiantNP("césar","lycurgus");
|
||||
Etudiant e2=new EtudiantNP("denis","uranus");
|
||||
Etudiant e3=new EtudiantNP("marcel","castor");
|
||||
@@ -198,8 +205,6 @@ public class TestTexteMNP{
|
||||
Iterator<Groupe> itgr = racineDeLaPartition.getSousGroupes().iterator();
|
||||
Groupe A = itgr.next(); // premier sous-groupe
|
||||
Groupe B = itgr.next(); // second sous-groupe
|
||||
fenetre.addGroupe(B);
|
||||
System.out.println(B.getName());
|
||||
B = itgr.next(); // troisième sous-groupe
|
||||
Etudiant e = A.getEtudiants().iterator().next();// premier étudiant du premier sous-groupe.
|
||||
acf.createChangement(A,e,B);
|
||||
@@ -235,6 +240,29 @@ public class TestTexteMNP{
|
||||
for (Changement cgt : acf.getAllChangements()){
|
||||
////System.out.println(cgt.monPrint());
|
||||
}
|
||||
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(
|
||||
"INSERT INTO `Groupe` (`id`, `nom`, `min`, `max`, `Type`, `etudiant`, `id-parent`, `id-sous-groupe`) VALUES (;");
|
||||
for(Etudiant et: agf.getPromotion().getEtudiants()){
|
||||
|
||||
}
|
||||
pst.close();
|
||||
}catch(SQLException ef){
|
||||
System.out.println("erreur dans la preparation");
|
||||
}
|
||||
cnx.close();
|
||||
}catch(SQLException ef){
|
||||
System.out.println("Erreur dans la connexion!");
|
||||
}
|
||||
}catch(ClassNotFoundException ef){
|
||||
System.out.println("pilote non disponible");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user