Compare commits
No commits in common. "239a3b33e7c6ea2d05494a3eab9233b50c1cd3ac" and "8841819f19ba92c5d56e863382f375f17926ce30" have entirely different histories.
239a3b33e7
...
8841819f19
@ -1,5 +1,4 @@
|
|||||||
package bdd;
|
package bdd;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Connexion.java
|
Connexion.java
|
||||||
Classe permettant d'établir une connexion avec une base de données mySQL
|
Classe permettant d'établir une connexion avec une base de données mySQL
|
||||||
@ -8,12 +7,10 @@ import java.sql.Connection;
|
|||||||
import java.sql.DriverManager;
|
import java.sql.DriverManager;
|
||||||
|
|
||||||
public class Connexion {
|
public class Connexion {
|
||||||
|
|
||||||
private static Connection connect; // Variable de connexion
|
private static Connection connect; // Variable de connexion
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructeur
|
* Constructeur
|
||||||
*
|
|
||||||
* @param serveur nom du serveur, localhost si local
|
* @param serveur nom du serveur, localhost si local
|
||||||
* @param bdd nom de la base de données
|
* @param bdd nom de la base de données
|
||||||
* @param nomUtil nom utilisateur
|
* @param nomUtil nom utilisateur
|
||||||
@ -47,9 +44,7 @@ public class Connexion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retourne la connection établie (Création d'une connection si elle
|
* Retourne la connection établie (Création d'une connection si elle n'existe pas)
|
||||||
* n'existe pas)
|
|
||||||
*
|
|
||||||
* @param serveur nom du serveur, localhost si local
|
* @param serveur nom du serveur, localhost si local
|
||||||
* @param bdd nom de la base de données
|
* @param bdd nom de la base de données
|
||||||
* @param nomUtil nom utilisateur
|
* @param nomUtil nom utilisateur
|
||||||
|
@ -23,7 +23,8 @@ public class PompierMysql {
|
|||||||
private Connection theConnection;
|
private Connection theConnection;
|
||||||
private Pompier unPompier;
|
private Pompier unPompier;
|
||||||
|
|
||||||
public PompierMysql() {
|
public PompierMysql()
|
||||||
|
{
|
||||||
theConnection = Connexion.getConnect("localhost", "sdis29", "admin", "minda");
|
theConnection = Connexion.getConnect("localhost", "sdis29", "admin", "minda");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,9 +68,8 @@ public class PompierMysql {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creation du client passé en paramètre dans la table client Requête non
|
* Creation du client passé en paramètre dans la table client
|
||||||
* préparée
|
* Requête non préparée
|
||||||
*
|
|
||||||
* @param c objet de type Client (sans identifiant)
|
* @param c objet de type Client (sans identifiant)
|
||||||
* @return int : id du client créé
|
* @return int : id du client créé
|
||||||
*/
|
*/
|
||||||
@ -111,9 +111,8 @@ public class PompierMysql {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creation du client passé en paramètre dans la table client Requête
|
* Creation du client passé en paramètre dans la table client
|
||||||
* préparée
|
* Requête préparée
|
||||||
*
|
|
||||||
* @param c objet de type Client (sans identifiant)
|
* @param c objet de type Client (sans identifiant)
|
||||||
* @return int : id du client créé
|
* @return int : id du client créé
|
||||||
*/
|
*/
|
||||||
@ -141,6 +140,7 @@ public class PompierMysql {
|
|||||||
System.out.println("Requête : " + stmt.toString());
|
System.out.println("Requête : " + stmt.toString());
|
||||||
int status = stmt.executeUpdate();
|
int status = stmt.executeUpdate();
|
||||||
|
|
||||||
|
|
||||||
// Recherche de l'identifiant du client créé
|
// Recherche de l'identifiant du client créé
|
||||||
if (status > 0) {
|
if (status > 0) {
|
||||||
ResultSet result = stmt.getGeneratedKeys();
|
ResultSet result = stmt.getGeneratedKeys();
|
||||||
|
@ -12,7 +12,6 @@ import java.util.Objects;
|
|||||||
* @author thomas.millot
|
* @author thomas.millot
|
||||||
*/
|
*/
|
||||||
public class Pompier {
|
public class Pompier {
|
||||||
|
|
||||||
private int id;
|
private int id;
|
||||||
private int idCaserne;
|
private int idCaserne;
|
||||||
private String nom;
|
private String nom;
|
||||||
@ -303,4 +302,5 @@ public class Pompier {
|
|||||||
return "Pompier{" + "id=" + id + ", idCaserne=" + idCaserne + ", nom=" + nom + ", prenom=" + prenom + ", Statut=" + Statut + ", typePers=" + typePers + ", mail=" + mail + ", login=" + login + ", mdp=" + mdp + ", adresse=" + adresse + ", cp=" + cp + ", ville=" + ville + ", bip=" + bip + ", nbGardes=" + nbGardes + ", grade=" + grade + ", commentaire=" + commentaire + ", dateEnreg=" + dateEnreg + ", dateModif=" + dateModif + '}';
|
return "Pompier{" + "id=" + id + ", idCaserne=" + idCaserne + ", nom=" + nom + ", prenom=" + prenom + ", Statut=" + Statut + ", typePers=" + typePers + ", mail=" + mail + ", login=" + login + ", mdp=" + mdp + ", adresse=" + adresse + ", cp=" + cp + ", ville=" + ville + ", bip=" + bip + ", nbGardes=" + nbGardes + ", grade=" + grade + ", commentaire=" + commentaire + ", dateEnreg=" + dateEnreg + ", dateModif=" + dateModif + '}';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,13 +6,11 @@
|
|||||||
package com.test.beans;
|
package com.test.beans;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author thomas.millot
|
* @author thomas.millot
|
||||||
*/
|
*/
|
||||||
public class User {
|
public class User {
|
||||||
|
|
||||||
private String pseudo;
|
private String pseudo;
|
||||||
private String mdp;
|
private String mdp;
|
||||||
|
|
||||||
|
@ -39,4 +39,5 @@ public class AuthentifForm {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -7,8 +7,6 @@
|
|||||||
<div id="contenu">
|
<div id="contenu">
|
||||||
<h2>Merci de vous identifier pour acceder aux dossiers</h2>
|
<h2>Merci de vous identifier pour acceder aux dossiers</h2>
|
||||||
<form name="frmIdentification" method="POST" action="">
|
<form name="frmIdentification" method="POST" action="">
|
||||||
<c:choose>
|
|
||||||
<c:when test="${empty param.ztPseudo}">
|
|
||||||
<fieldset><legend>Identification utilisateur</legend>
|
<fieldset><legend>Identification utilisateur</legend>
|
||||||
<br /><br />
|
<br /><br />
|
||||||
<label for="nom">Nom du compte</label>
|
<label for="nom">Nom du compte</label>
|
||||||
@ -22,15 +20,8 @@
|
|||||||
<input type="reset" name="annuler" value="Annuler">
|
<input type="reset" name="annuler" value="Annuler">
|
||||||
</p>
|
</p>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</c:when>
|
|
||||||
<c:otherwise>
|
|
||||||
<!-- Si l'utilisateur s'est authentifié,
|
|
||||||
Affichage du message contenu dans l'objet controlForm de type AuthentifForm -->
|
|
||||||
|
|
||||||
<p>${controlForm.getResultat()}</p>
|
|
||||||
</c:otherwise>
|
|
||||||
</c:choose>
|
|
||||||
</form>
|
</form>
|
||||||
<br /><br />
|
<br /><br />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user