Compare commits

..

No commits in common. "fdaace4310f7efefe6fceb67157d91c3a8e8506e" and "cd8af9940daf712505d25208a1763926a0123144" have entirely different histories.

4 changed files with 34 additions and 16 deletions

View File

@ -0,0 +1,24 @@
/*
* 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");
}

View File

@ -5,7 +5,6 @@
package TEST; package TEST;
import acces_aux_donnes.connexionSQL; import acces_aux_donnes.connexionSQL;
import acces_aux_donnes.praticienSQL;
import java.sql.Connection; import java.sql.Connection;
/** /**
@ -19,14 +18,11 @@ public class testMain {
*/ */
public static void main(String[] args) { 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 //Elio
//Connection connexionTest = connexionSQL.getConnect("10.121.38.75","bdgsb","adminGSB","mdpGSB"); //Connection connexionTest = connexionSQL.getConnect("10.121.38.75","bdgsb","adminGSB","mdpGSB");
//Yann //Yann
//Connection connexionTest = connexionSQL.getConnect("10.121.38.69","bdgsb","appliGSB","(Uq1XV0Tr01s2H9Z"); //Connection connexionTest = connexionSQL.getConnect("10.121.38.69","bdgsb","appliGSB","(Uq1XV0Tr01s2H9Z");
praticienSQL a =new praticienSQL();
a.rechercherPraticien("Didier", "1234");
} }

View File

@ -19,17 +19,17 @@ public class praticienSQL {
private ResultSet result = null; private ResultSet result = null;
public praticienSQL() { public praticienSQL() {
connexionTest = connexionSQL.getConnect("10.121.38.75","bdgsb","adminGSB","mdpGSB"); connexionTest = connexionSQL.getConnect("10.121.38.173","bdmagasin", "adminBDMag", "mdpBDMag");
} }
public String[] rechercherPraticien(String login, String mdp) { public String[] rechercherPraticien(String login, String mdp) {
String[] praticienCherche = new String [2]; String[] praticienCherche = new String [2];
try { try {
stmt = connexionTest.createStatement(); stmt = connexionTest.createStatement();
// Accès à la table // Accès à la table client
result = stmt.executeQuery("SELECT * FROM PRATICIENLOG WHERE id='"+login+ result = stmt.executeQuery("SELECT * FROM client WHERE nom='"+login+
"' AND mdp='"+mdp + "';"); "' AND mdp='"+mdp + "';");
if (result.next()) { // Le praticien a été touvé if (result.next()) { // Le client a été touvé
praticienCherche[0] = result.getString(1); praticienCherche[0] = result.getString(1);
praticienCherche[1] = result.getString(2); praticienCherche[1] = result.getString(2);

View File

@ -157,13 +157,11 @@ public class jffConnexion extends javax.swing.JFrame {
private void jBValiderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBValiderActionPerformed private void jBValiderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBValiderActionPerformed
String identifiant = jTFIdentifiant.getText(); String identifiant = jTFIdentifiant.getText();
String mdp = String.valueOf(jPFmdp.getPassword()); String motPasse = jPFmdp.getText();
praticienSQL testPraticien = new praticienSQL(); praticienSQL testPraticien = new praticienSQL();
String [] lePraticien = testPraticien.rechercherPraticien(identifiant,mdp);
if (lePraticien[0] != null){ if (jTFIdentifiant.getText().equals(identifiant) && jPFmdp.getText().equals(motPasse)){
System.out.print("TEST REUSSIE"); System.out.println("Gagner");
}else {
System.out.print("TEST EMILE RACISTE");
} }
}//GEN-LAST:event_jBValiderActionPerformed }//GEN-LAST:event_jBValiderActionPerformed