Connexion BDD v1
This commit is contained in:
@@ -2,6 +2,7 @@ package fr.eni.enchere.dall;
|
|||||||
|
|
||||||
import fr.eni.enchere.bo.User;
|
import fr.eni.enchere.bo.User;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||||
import org.springframework.jdbc.core.JdbcTemplate;
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
|
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
|
||||||
import org.springframework.jdbc.support.GeneratedKeyHolder;
|
import org.springframework.jdbc.support.GeneratedKeyHolder;
|
||||||
@@ -33,7 +34,7 @@ public class UserRepositoryImpl implements UserRepository {
|
|||||||
@Override
|
@Override
|
||||||
public void save(User utilisateur) {
|
public void save(User utilisateur) {
|
||||||
if (utilisateur.getId() == 0) {
|
if (utilisateur.getId() == 0) {
|
||||||
String sql = "insert into UTILISATEURS (pseudo, nom, prenom, email, telephone," +
|
String sql = "INSERT INTO UTILISATEURS (pseudo, nom, prenom, email, telephone," +
|
||||||
" rue, code_postal, ville, mot_de_passe, credit, administrateur)" +
|
" rue, code_postal, ville, mot_de_passe, credit, administrateur)" +
|
||||||
" values (:pseudo, :nom, :prenom, :email, :telephone," +
|
" values (:pseudo, :nom, :prenom, :email, :telephone," +
|
||||||
" :rue, :code_postal, :ville, :mot_de_passe, 0, false)";
|
" :rue, :code_postal, :ville, :mot_de_passe, 0, false)";
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
spring.datasource.url=jdbc:mariadb://91.121.54.36:3306/eni_enchere
|
spring.datasource.url=jdbc:mariadb://91.121.54.36:3306/eni_enchere
|
||||||
spring.datasource.username=eni
|
spring.datasource.username=eni
|
||||||
spring.datasource.password=Pa$$w0rd
|
spring.datasource.password=Pa$$w0rd
|
||||||
|
|||||||
Reference in New Issue
Block a user