base fonctionnel pour l'affichage (todo tableau), utilisateur seulement pour l'instant
This commit is contained in:
BIN
data/test.lck
Normal file
BIN
data/test.lck
Normal file
Binary file not shown.
33
data/test.log
Normal file
33
data/test.log
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
/*C1*/SET SCHEMA SYSTEM_LOBS
|
||||||
|
INSERT INTO BLOCKS VALUES(0,2147483647,0)
|
||||||
|
COMMIT
|
||||||
|
/*C2*/SET SCHEMA PUBLIC
|
||||||
|
create sequence Quizz_SEQ start with 1 increment by 50
|
||||||
|
create sequence Reponse_SEQ start with 1 increment by 50
|
||||||
|
create table Choix (Choix_Id integer not null, choix varchar(255) array, primary key (Choix_Id))
|
||||||
|
create table Question (bonne_reponse integer unique, id integer generated by default as identity (start with 1), primary key (id))
|
||||||
|
create table Quizz (id integer not null, id_utilisateur integer, session_codePIN integer, primary key (id))
|
||||||
|
create table Reponse (id integer not null, question_id integer unique, Type_reponse varchar(31) not null, reponses varchar(255) array, primary key (id))
|
||||||
|
create table ReponseCourte (RC_Id integer not null, value varchar(255), primary key (RC_Id))
|
||||||
|
create table Session (codePIN integer generated by default as identity (start with 1), theme varchar(255), primary key (codePIN))
|
||||||
|
create table Utilisateur (id integer generated by default as identity (start with 1), email varchar(255) unique, name varchar(255), password varchar(255), primary key (id))
|
||||||
|
create table utilisateur_session (session_pin integer not null, utilisateur_id integer not null)
|
||||||
|
alter table Choix add constraint FK15f4fgmtoco1tg4rra1vualr5 foreign key (Choix_Id) references Reponse
|
||||||
|
alter table Question add constraint FKht8pe2o5v6sff88mr3pbh40f6 foreign key (bonne_reponse) references Reponse
|
||||||
|
alter table Quizz add constraint FK3d0s5ih3homovqibbm72mvn2j foreign key (session_codePIN) references Session
|
||||||
|
alter table Quizz add constraint FKlsvn0pvga68ummfyividlwggh foreign key (id_utilisateur) references Utilisateur
|
||||||
|
alter table Reponse add constraint FKgdr6si626nqixg8qyfx6s0pjl foreign key (question_id) references Question
|
||||||
|
alter table ReponseCourte add constraint FKocs5t60ov4kwoom69761ay7qd foreign key (RC_Id) references Reponse
|
||||||
|
alter table utilisateur_session add constraint FK8x6kccp60a5ki9i4wihglhgqm foreign key (session_pin) references Session
|
||||||
|
alter table utilisateur_session add constraint FK4f5dgiwf12kd9vrhsc6s4x2pk foreign key (utilisateur_id) references Utilisateur
|
||||||
|
INSERT INTO UTILISATEUR VALUES(1,'v','a',NULL)
|
||||||
|
COMMIT
|
||||||
|
DISCONNECT
|
||||||
|
/*C3*/SET SCHEMA PUBLIC
|
||||||
|
DISCONNECT
|
||||||
|
/*C4*/SET SCHEMA PUBLIC
|
||||||
|
DISCONNECT
|
||||||
|
/*C5*/SET SCHEMA PUBLIC
|
||||||
|
DISCONNECT
|
||||||
|
/*C6*/SET SCHEMA PUBLIC
|
||||||
|
DISCONNECT
|
||||||
5
data/test.properties
Normal file
5
data/test.properties
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#HSQL Database Engine 2.7.2
|
||||||
|
#Thu Sep 25 12:18:09 CEST 2025
|
||||||
|
modified=yes
|
||||||
|
tx_timestamp=1
|
||||||
|
version=2.7.2
|
||||||
44
data/test.script
Normal file
44
data/test.script
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
SET DATABASE UNIQUE NAME HSQLDB9980615EC0
|
||||||
|
SET DATABASE DEFAULT RESULT MEMORY ROWS 0
|
||||||
|
SET DATABASE EVENT LOG LEVEL 0
|
||||||
|
SET DATABASE TRANSACTION CONTROL LOCKS
|
||||||
|
SET DATABASE DEFAULT ISOLATION LEVEL READ COMMITTED
|
||||||
|
SET DATABASE TRANSACTION ROLLBACK ON CONFLICT TRUE
|
||||||
|
SET DATABASE TEXT TABLE DEFAULTS ''
|
||||||
|
SET DATABASE SQL NAMES FALSE
|
||||||
|
SET DATABASE SQL RESTRICT EXEC FALSE
|
||||||
|
SET DATABASE SQL REFERENCES FALSE
|
||||||
|
SET DATABASE SQL SIZE TRUE
|
||||||
|
SET DATABASE SQL TYPES FALSE
|
||||||
|
SET DATABASE SQL TDC DELETE TRUE
|
||||||
|
SET DATABASE SQL TDC UPDATE TRUE
|
||||||
|
SET DATABASE SQL SYS INDEX NAMES TRUE
|
||||||
|
SET DATABASE SQL CONCAT NULLS TRUE
|
||||||
|
SET DATABASE SQL UNIQUE NULLS TRUE
|
||||||
|
SET DATABASE SQL CONVERT TRUNCATE TRUE
|
||||||
|
SET DATABASE SQL AVG SCALE 0
|
||||||
|
SET DATABASE SQL DOUBLE NAN TRUE
|
||||||
|
SET FILES WRITE DELAY 500 MILLIS
|
||||||
|
SET FILES BACKUP INCREMENT TRUE
|
||||||
|
SET FILES CACHE SIZE 10000
|
||||||
|
SET FILES CACHE ROWS 50000
|
||||||
|
SET FILES SCALE 32
|
||||||
|
SET FILES LOB SCALE 32
|
||||||
|
SET FILES DEFRAG 0
|
||||||
|
SET FILES NIO TRUE
|
||||||
|
SET FILES NIO SIZE 256
|
||||||
|
SET FILES LOG TRUE
|
||||||
|
SET FILES LOG SIZE 50
|
||||||
|
SET FILES CHECK 1
|
||||||
|
SET DATABASE COLLATION SQL_TEXT PAD SPACE
|
||||||
|
CREATE USER SA PASSWORD DIGEST 'd41d8cd98f00b204e9800998ecf8427e'
|
||||||
|
ALTER USER SA SET LOCAL TRUE
|
||||||
|
CREATE SCHEMA PUBLIC AUTHORIZATION DBA
|
||||||
|
ALTER SEQUENCE SYSTEM_LOBS.LOB_ID RESTART WITH 1
|
||||||
|
SET DATABASE DEFAULT INITIAL SCHEMA PUBLIC
|
||||||
|
GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.CARDINAL_NUMBER TO PUBLIC
|
||||||
|
GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.YES_OR_NO TO PUBLIC
|
||||||
|
GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.CHARACTER_DATA TO PUBLIC
|
||||||
|
GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.SQL_IDENTIFIER TO PUBLIC
|
||||||
|
GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.TIME_STAMP TO PUBLIC
|
||||||
|
GRANT DBA TO SA
|
||||||
43
src/main/java/servlet/Show.java
Normal file
43
src/main/java/servlet/Show.java
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
package servlet;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import DAO.*;
|
||||||
|
import jakarta.servlet.ServletException;
|
||||||
|
import jakarta.servlet.annotation.WebServlet;
|
||||||
|
import jakarta.servlet.http.HttpServlet;
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import metier.Utilisateur;
|
||||||
|
|
||||||
|
@WebServlet(name="Show", urlPatterns={"/Show"})
|
||||||
|
public class Show extends HttpServlet {
|
||||||
|
Utilisateur u;
|
||||||
|
QuizzDAO quizzDAI = new QuizzDAO();
|
||||||
|
UtilisateurDAO utilisateurDAO = new UtilisateurDAO();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||||
|
response.setContentType("text/html");
|
||||||
|
|
||||||
|
List<Utilisateur> listUser = utilisateurDAO.findAll();
|
||||||
|
|
||||||
|
String result = "<HTML>\n<BODY>\n";
|
||||||
|
|
||||||
|
result += "<H2>Utilisateurs :</H2>";
|
||||||
|
for (Utilisateur u : listUser) {
|
||||||
|
|
||||||
|
result += u.getName();
|
||||||
|
result += u.getId();
|
||||||
|
result += u.getEmail();
|
||||||
|
result += u.getPassword();
|
||||||
|
}
|
||||||
|
|
||||||
|
result += "</BODY>\n</HTML>";
|
||||||
|
|
||||||
|
response.getWriter().write(result);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
package servlet;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.PrintWriter;
|
|
||||||
|
|
||||||
import DAO.*;
|
|
||||||
import jakarta.servlet.ServletException;
|
|
||||||
import jakarta.servlet.annotation.WebServlet;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
import metier.Utilisateur;
|
|
||||||
|
|
||||||
@WebServlet(name="show", urlPatterns={"/show"})
|
|
||||||
public class show {
|
|
||||||
Utilisateur u;
|
|
||||||
|
|
||||||
UtilisateurDAO utilisateurDAO = new UtilisateurDAO();
|
|
||||||
|
|
||||||
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
|
||||||
response.setContentType("text/html");
|
|
||||||
|
|
||||||
Utilisateur u = new Utilisateur();
|
|
||||||
u.setName(request.getParameter("name"));
|
|
||||||
u.setEmail(request.getParameter("email"));
|
|
||||||
|
|
||||||
utilisateurDAO.create(u);
|
|
||||||
PrintWriter out = response.getWriter();
|
|
||||||
out.println("<HTML>\n<BODY>\n" +
|
|
||||||
"<H1>Recapitulatif des informations de Tibo</H1>\n" +
|
|
||||||
"<UL>\n" + " <LI>Nom: " + request.getParameter("name") +
|
|
||||||
"\n" + " <LI>Email: " + request.getParameter("email") + "\n" +
|
|
||||||
" <LI>Age: " + request.getParameter("age") + "\n" + "</UL>\n" +
|
|
||||||
"</BODY></HTML>");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<h1>Hello World!</h1>
|
<h1>Hello World!</h1>
|
||||||
<a href =http://localhost:8080/myform.html>myform</a>
|
<a href =http://localhost:8080/myform.html>myform</a>
|
||||||
<a href =http://localhost:8080/show>show</a>
|
<a href =Show>show</a>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user