visiteurSql
This commit is contained in:
parent
546a6a8717
commit
2e3414be26
@ -19,7 +19,7 @@ public class MedicamentSQL {
|
|||||||
private ResultSet result = null;
|
private ResultSet result = null;
|
||||||
|
|
||||||
public MedicamentSQL() {
|
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){
|
public ArrayList<String> rechercherMedicament (String nomCo){
|
||||||
|
@ -21,7 +21,7 @@ public class familleMedocSQL {
|
|||||||
private ResultSet result = null;
|
private ResultSet result = null;
|
||||||
|
|
||||||
public familleMedocSQL(){
|
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(){
|
public Vector<String> rechercheFamille(){
|
||||||
|
@ -21,7 +21,7 @@ public class observationSQL {
|
|||||||
private ResultSet result = null;
|
private ResultSet result = null;
|
||||||
|
|
||||||
public observationSQL() {
|
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(){
|
public int compterLignes(){
|
||||||
|
@ -20,7 +20,7 @@ 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.69","bdgsb","appliGSB","(Uq1XV0Tr01s2H9Z");
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList<String> rechercherPraticien(String login, String mdp) {
|
public ArrayList<String> rechercherPraticien(String login, String mdp) {
|
||||||
|
@ -20,7 +20,7 @@ public class visiteurSQL {
|
|||||||
private ResultSet result = null;
|
private ResultSet result = null;
|
||||||
|
|
||||||
public visiteurSQL() {
|
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) {
|
public ArrayList<String> rechercherVisiteur(String login, String mdp) {
|
||||||
@ -28,11 +28,14 @@ public class visiteurSQL {
|
|||||||
try {
|
try {
|
||||||
stmt = connexionTest.createStatement();
|
stmt = connexionTest.createStatement();
|
||||||
// Accès à la table
|
// 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é
|
if (result.next()) { // Le praticien a été touvé
|
||||||
visiteurCherche.add(result.getString(1));
|
visiteurCherche.add(result.getString(1));
|
||||||
visiteurCherche.add(result.getString(2));
|
visiteurCherche.add(result.getString(2));
|
||||||
|
System.out.println(visiteurCherche.add(result.getString(1)));
|
||||||
|
|
||||||
}
|
}
|
||||||
result.close();
|
result.close();
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
package presentation;
|
package presentation;
|
||||||
|
|
||||||
import acces_aux_donnes.praticienSQL;
|
import acces_aux_donnes.praticienSQL;
|
||||||
|
import acces_aux_donnes.visiteurSQL;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
|
|
||||||
@ -158,6 +159,7 @@ public class jffConnexion extends javax.swing.JFrame {
|
|||||||
}//GEN-LAST:event_jPFmdpActionPerformed
|
}//GEN-LAST:event_jPFmdpActionPerformed
|
||||||
|
|
||||||
private void jBValiderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBValiderActionPerformed
|
private void jBValiderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBValiderActionPerformed
|
||||||
|
if(this.profession == 0){
|
||||||
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();
|
||||||
@ -167,6 +169,20 @@ public class jffConnexion extends javax.swing.JFrame {
|
|||||||
}else {
|
}else {
|
||||||
JOptionPane.showMessageDialog(null,"Erreur de connexion, Veuillez recommencer");
|
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
|
}//GEN-LAST:event_jBValiderActionPerformed
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -199,7 +215,6 @@ public class jffConnexion extends javax.swing.JFrame {
|
|||||||
/* Create and display the form */
|
/* Create and display the form */
|
||||||
java.awt.EventQueue.invokeLater(new Runnable() {
|
java.awt.EventQueue.invokeLater(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
new jffConnexion(1).setVisible(true);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user