visiteurSql

This commit is contained in:
emile.malcuit 2025-03-14 09:03:04 +01:00
parent 546a6a8717
commit 2e3414be26
6 changed files with 37 additions and 19 deletions

View File

@ -19,7 +19,7 @@ public class MedicamentSQL {
private ResultSet result = null;
public MedicamentSQL() {
connexionTest = connexionSQL.getConnect("10.121.38.75","bdgsb","adminGSB","mdpGSB");
connexionTest = connexionSQL.getConnect("10.121.38.69","bdgsb","appliGSB","(Uq1XV0Tr01s2H9Z");
}
public ArrayList<String> rechercherMedicament (String nomCo){

View File

@ -21,7 +21,7 @@ public class familleMedocSQL {
private ResultSet result = null;
public familleMedocSQL(){
connexionTest = connexionSQL.getConnect("10.121.38.75","bdgsb","adminGSB","mdpGSB");
connexionTest = connexionSQL.getConnect("10.121.38.69","bdgsb","appliGSB","(Uq1XV0Tr01s2H9Z");
}
public Vector<String> rechercheFamille(){

View File

@ -21,7 +21,7 @@ public class observationSQL {
private ResultSet result = null;
public observationSQL() {
connexionTest = connexionSQL.getConnect("10.121.38.75","bdgsb","adminGSB","mdpGSB");
connexionTest = connexionSQL.getConnect("10.121.38.69","bdgsb","appliGSB","(Uq1XV0Tr01s2H9Z");
}
public int compterLignes(){

View File

@ -20,7 +20,7 @@ public class praticienSQL {
private ResultSet result = null;
public praticienSQL() {
connexionTest = connexionSQL.getConnect("10.121.38.75","bdgsb","adminGSB","mdpGSB");
connexionTest = connexionSQL.getConnect("10.121.38.69","bdgsb","appliGSB","(Uq1XV0Tr01s2H9Z");
}
public ArrayList<String> rechercherPraticien(String login, String mdp) {

View File

@ -20,7 +20,7 @@ public class visiteurSQL {
private ResultSet result = null;
public visiteurSQL() {
connexionTest = connexionSQL.getConnect("10.121.38.75","bdgsb","adminGSB","mdpGSB");
connexionTest = connexionSQL.getConnect("10.121.38.69","bdgsb","appliGSB","(Uq1XV0Tr01s2H9Z");
}
public ArrayList<String> rechercherVisiteur(String login, String mdp) {
@ -28,11 +28,14 @@ public class visiteurSQL {
try {
stmt = connexionTest.createStatement();
// Accès à la table
result = stmt.executeQuery("SELECT * FROM PRATICIENLOG WHERE nom='"+login+
"' AND Mdp='"+mdp + "';");
result = stmt.executeQuery("SELECT * FROM VISITEUR WHERE vNom='"+login+
"' AND vMdp='"+mdp + "';");
if (result.next()) { // Le praticien a été touvé
visiteurCherche.add(result.getString(1));
visiteurCherche.add(result.getString(2));
visiteurCherche.add(result.getString(1));
visiteurCherche.add(result.getString(2));
System.out.println(visiteurCherche.add(result.getString(1)));
}
result.close();

View File

@ -5,6 +5,7 @@
package presentation;
import acces_aux_donnes.praticienSQL;
import acces_aux_donnes.visiteurSQL;
import java.util.ArrayList;
import javax.swing.JOptionPane;
@ -158,15 +159,30 @@ public class jffConnexion extends javax.swing.JFrame {
}//GEN-LAST:event_jPFmdpActionPerformed
private void jBValiderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBValiderActionPerformed
String identifiant = jTFIdentifiant.getText();
String mdp = String.valueOf(jPFmdp.getPassword());
praticienSQL testPraticien = new praticienSQL();
ArrayList<String>lePraticien = testPraticien.rechercherPraticien(identifiant,mdp);
if (lePraticien.get(0) != null){
new jffFamilleMedoc().setVisible(true);
}else {
JOptionPane.showMessageDialog(null,"Erreur de connexion, Veuillez recommencer");
}
if(this.profession == 0){
String identifiant = jTFIdentifiant.getText();
String mdp = String.valueOf(jPFmdp.getPassword());
praticienSQL testPraticien = new praticienSQL();
ArrayList<String>lePraticien = testPraticien.rechercherPraticien(identifiant,mdp);
if (lePraticien.get(0) != null){
new jffFamilleMedoc().setVisible(true);
}else {
JOptionPane.showMessageDialog(null,"Erreur de connexion, Veuillez recommencer");
}
}else{
String identifiant = jTFIdentifiant.getText();
String mdp = String.valueOf(jPFmdp.getPassword());
visiteurSQL testVisiteur = new visiteurSQL();
ArrayList<String>leVisiteur = testVisiteur.rechercherVisiteur(identifiant,mdp);
System.out.println(leVisiteur.get(0));
if (leVisiteur.get(0) != null){
new jffFamilleMedoc().setVisible(true);
}else {
JOptionPane.showMessageDialog(null,"Erreur de connexion, Veuillez recommencer");
}
}
this.setVisible(false);
}//GEN-LAST:event_jBValiderActionPerformed
/**
@ -199,7 +215,6 @@ public class jffConnexion extends javax.swing.JFrame {
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new jffConnexion(1).setVisible(true);
}
});
}