From 20497f31d39d4b63131cba7cf86cdff3db79fc0e Mon Sep 17 00:00:00 2001 From: "medhi.rodrigues" Date: Wed, 12 Mar 2025 15:54:23 +0100 Subject: [PATCH 1/2] Jvais me tuer la doc --- GSBapplication/src/TEST/test.java | 24 ------------------- GSBapplication/src/TEST/testMain.java | 6 ++++- .../src/acces_aux_donnes/praticienSQL.java | 8 +++---- .../src/presentation/jffConnexion.java | 10 ++++---- 4 files changed, 14 insertions(+), 34 deletions(-) delete mode 100644 GSBapplication/src/TEST/test.java diff --git a/GSBapplication/src/TEST/test.java b/GSBapplication/src/TEST/test.java deleted file mode 100644 index 1498c43..0000000 --- a/GSBapplication/src/TEST/test.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license - * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template - */ -package TEST; - -import acces_aux_donnes.connexionSQL; -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.Statement; - -/** - * - * @author emile.lalorcey - */ -public class test { - private Connection connexionTest; - private Statement stmt = null; - private ResultSet result = null; - - - connexionTest = connexionSQL.getConnect("10.121.38.196","bdgsb","admin","admin"); - -} diff --git a/GSBapplication/src/TEST/testMain.java b/GSBapplication/src/TEST/testMain.java index e6dd63a..4120c83 100644 --- a/GSBapplication/src/TEST/testMain.java +++ b/GSBapplication/src/TEST/testMain.java @@ -5,6 +5,7 @@ package TEST; import acces_aux_donnes.connexionSQL; +import acces_aux_donnes.praticienSQL; import java.sql.Connection; /** @@ -17,12 +18,15 @@ public class testMain { * @param args the command line arguments */ public static void main(String[] args) { + - Connection connexionTest = connexionSQL.getConnect("10.121.38.196","bdgsb","adminGSB","mdpGSB"); + //Connection connexionTest = connexionSQL.getConnect("10.121.38.196","bdgsb","adminGSB","mdpGSB"); //Elio //Connection connexionTest = connexionSQL.getConnect("10.121.38.75","bdgsb","adminGSB","mdpGSB"); //Yann //Connection connexionTest = connexionSQL.getConnect("10.121.38.69","bdgsb","appliGSB","(Uq1XV0Tr01s2H9Z"); + praticienSQL a =new praticienSQL(); + a.rechercherPraticien("Didier", "1234"); } diff --git a/GSBapplication/src/acces_aux_donnes/praticienSQL.java b/GSBapplication/src/acces_aux_donnes/praticienSQL.java index ef9868d..493bed5 100644 --- a/GSBapplication/src/acces_aux_donnes/praticienSQL.java +++ b/GSBapplication/src/acces_aux_donnes/praticienSQL.java @@ -19,17 +19,17 @@ public class praticienSQL { private ResultSet result = null; public praticienSQL() { - connexionTest = connexionSQL.getConnect("10.121.38.173","bdmagasin", "adminBDMag", "mdpBDMag"); + connexionTest = connexionSQL.getConnect("10.121.38.75","bdgsb","adminGSB","mdpGSB"); } public String[] rechercherPraticien(String login, String mdp) { String[] praticienCherche = new String [2]; try { stmt = connexionTest.createStatement(); - // Accès à la table client - result = stmt.executeQuery("SELECT * FROM client WHERE nom='"+login+ + // Accès à la table + result = stmt.executeQuery("SELECT * FROM PRATICIENLOG WHERE id='"+login+ "' AND mdp='"+mdp + "';"); - if (result.next()) { // Le client a été touvé + if (result.next()) { // Le praticien a été touvé praticienCherche[0] = result.getString(1); praticienCherche[1] = result.getString(2); diff --git a/GSBapplication/src/presentation/jffConnexion.java b/GSBapplication/src/presentation/jffConnexion.java index 5e94ca7..8b25bb8 100644 --- a/GSBapplication/src/presentation/jffConnexion.java +++ b/GSBapplication/src/presentation/jffConnexion.java @@ -157,12 +157,12 @@ public class jffConnexion extends javax.swing.JFrame { private void jBValiderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBValiderActionPerformed String identifiant = jTFIdentifiant.getText(); - String motPasse = jPFmdp.getText(); + String mdp = String.valueOf(jPFmdp.getPassword()); praticienSQL testPraticien = new praticienSQL(); - - if (jTFIdentifiant.getText().equals(identifiant) && jPFmdp.getText().equals(motPasse)){ - System.out.println("Gagner"); - } + String [] lePraticien = testPraticien.rechercherPraticien(identifiant,mdp); + if (lePraticien[0] != null){ + System.out.print("TEST REUSSIE"); + } }//GEN-LAST:event_jBValiderActionPerformed /** -- 2.47.2 From 655fa5c049a0398a067d8f67e6b26f02d956c009 Mon Sep 17 00:00:00 2001 From: "medhi.rodrigues" Date: Wed, 12 Mar 2025 16:16:57 +0100 Subject: [PATCH 2/2] Jvais me tuer la doc du racisme --- GSBapplication/src/presentation/jffConnexion.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GSBapplication/src/presentation/jffConnexion.java b/GSBapplication/src/presentation/jffConnexion.java index 8b25bb8..aa1c02a 100644 --- a/GSBapplication/src/presentation/jffConnexion.java +++ b/GSBapplication/src/presentation/jffConnexion.java @@ -162,7 +162,9 @@ public class jffConnexion extends javax.swing.JFrame { String [] lePraticien = testPraticien.rechercherPraticien(identifiant,mdp); if (lePraticien[0] != null){ System.out.print("TEST REUSSIE"); - } + }else { + System.out.print("TEST EMILE RACISTE"); + } }//GEN-LAST:event_jBValiderActionPerformed /** -- 2.47.2