Compare commits

..

1 Commits

Author SHA1 Message Date
86f1731141 observation à finir 2025-03-13 14:38:35 +01:00
8 changed files with 16 additions and 86 deletions

View File

@ -19,7 +19,7 @@ public class MedicamentSQL {
private ResultSet result = null;
public MedicamentSQL() {
connexionTest = connexionSQL.getConnect("10.121.38.69","bdgsb","appliGSB","(Uq1XV0Tr01s2H9Z");
connexionTest = connexionSQL.getConnect("10.121.38.75","bdgsb","adminGSB","mdpGSB");
}
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.69","bdgsb","appliGSB","(Uq1XV0Tr01s2H9Z");
connexionTest = connexionSQL.getConnect("10.121.38.75","bdgsb","adminGSB","mdpGSB");
}
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.69","bdgsb","appliGSB","(Uq1XV0Tr01s2H9Z");
connexionTest = connexionSQL.getConnect("10.121.38.75","bdgsb","adminGSB","mdpGSB");
}
public int compterLignes(){

View File

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

View File

@ -1,51 +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 acces_aux_donnes;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
/**
*
* @author medhi.rodrigues
*/
public class visiteurSQL {
private Connection connexionTest;
private Statement stmt = null;
private ResultSet result = null;
public visiteurSQL() {
connexionTest = connexionSQL.getConnect("10.121.38.69","bdgsb","appliGSB","(Uq1XV0Tr01s2H9Z");
}
public ArrayList<String> rechercherVisiteur(String login, String mdp) {
ArrayList<String> visiteurCherche = new ArrayList<String>();
try {
stmt = connexionTest.createStatement();
// Accès à la table
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));
System.out.println(visiteurCherche.add(result.getString(1)));
}
result.close();
stmt.close();
} catch (SQLException ex) {
System.out.println("SQLException : " + ex.getMessage());
System.out.println("SQLState : " + ex.getSQLState());
System.out.println("Code erreur : " + ex.getErrorCode());
}
return visiteurCherche;
}
}

View File

@ -5,9 +5,7 @@
package presentation;
import acces_aux_donnes.praticienSQL;
import acces_aux_donnes.visiteurSQL;
import java.util.ArrayList;
import javax.swing.JOptionPane;
/**
*
@ -159,32 +157,16 @@ public class jffConnexion extends javax.swing.JFrame {
}//GEN-LAST:event_jPFmdpActionPerformed
private void jBValiderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBValiderActionPerformed
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 {
leVisiteur.add("12");
//JOptionPane.showMessageDialog(null,"Erreur de connexion, Veuillez recommencer");
}
}
this.setVisible(false);
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){
System.out.print("TEST REUSSIE");
new jffFamilleMedoc().setVisible(true);
}else {
System.out.print("TEST EMILE RACISTE");
}
}//GEN-LAST:event_jBValiderActionPerformed
/**
@ -217,6 +199,7 @@ 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);
}
});
}

View File

@ -10,7 +10,6 @@ import acces_aux_donnes.familleMedocSQL;
import java.util.ArrayList;
import java.util.Vector;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JOptionPane;
/**
*
@ -147,7 +146,7 @@ public class jffFamilleMedoc extends javax.swing.JFrame {
}else {
JOptionPane.showMessageDialog(null,"Veuillez choisir un médicament valide");
//ajout d'un JoptionPane
}
}//GEN-LAST:event_jBRechercheValideActionPerformed

View File

@ -15,7 +15,6 @@ public class jffProfession extends javax.swing.JFrame {
*/
public jffProfession() {
initComponents();
}
/**