Merge pull request 'fin fonction' (#24) from jave.Emile into main
Reviewed-on: #24
This commit is contained in:
commit
35043c5d54
@ -8,6 +8,7 @@ import java.sql.Connection;
|
|||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.sql.Statement;
|
import java.sql.Statement;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -22,16 +23,16 @@ public class praticienSQL {
|
|||||||
connexionTest = connexionSQL.getConnect("10.121.38.75","bdgsb","adminGSB","mdpGSB");
|
connexionTest = connexionSQL.getConnect("10.121.38.75","bdgsb","adminGSB","mdpGSB");
|
||||||
}
|
}
|
||||||
|
|
||||||
public String[] rechercherPraticien(String login, String mdp) {
|
public ArrayList<String> rechercherPraticien(String login, String mdp) {
|
||||||
String[] praticienCherche = new String [2];
|
ArrayList<String> praticienCherche = new ArrayList<String>();
|
||||||
try {
|
try {
|
||||||
stmt = connexionTest.createStatement();
|
stmt = connexionTest.createStatement();
|
||||||
// Accès à la table
|
// Accès à la table
|
||||||
result = stmt.executeQuery("SELECT * FROM PRATICIENLOG WHERE id='"+login+
|
result = stmt.executeQuery("SELECT * FROM PRATICIENLOG WHERE id='"+login+
|
||||||
"' AND mdp='"+mdp + "';");
|
"' AND mdp='"+mdp + "';");
|
||||||
if (result.next()) { // Le praticien a été touvé
|
if (result.next()) { // Le praticien a été touvé
|
||||||
praticienCherche[0] = result.getString(1);
|
praticienCherche.add(result.getString(1));
|
||||||
praticienCherche[1] = result.getString(2);
|
praticienCherche.add(result.getString(2));
|
||||||
|
|
||||||
}
|
}
|
||||||
result.close();
|
result.close();
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
package presentation;
|
package presentation;
|
||||||
|
|
||||||
import acces_aux_donnes.praticienSQL;
|
import acces_aux_donnes.praticienSQL;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -159,9 +160,10 @@ public class jffConnexion extends javax.swing.JFrame {
|
|||||||
String identifiant = jTFIdentifiant.getText();
|
String identifiant = jTFIdentifiant.getText();
|
||||||
String mdp = String.valueOf(jPFmdp.getPassword());
|
String mdp = String.valueOf(jPFmdp.getPassword());
|
||||||
praticienSQL testPraticien = new praticienSQL();
|
praticienSQL testPraticien = new praticienSQL();
|
||||||
String [] lePraticien = testPraticien.rechercherPraticien(identifiant,mdp);
|
ArrayList<String>lePraticien = testPraticien.rechercherPraticien(identifiant,mdp);
|
||||||
if (lePraticien[0] != null){
|
if (lePraticien.get(0) != null){
|
||||||
System.out.print("TEST REUSSIE");
|
System.out.print("TEST REUSSIE");
|
||||||
|
new jffFamilleMedoc().setVisible(true);
|
||||||
}else {
|
}else {
|
||||||
System.out.print("TEST EMILE RACISTE");
|
System.out.print("TEST EMILE RACISTE");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user