Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
S4a021 Web Backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Charlie Darques
S4a021 Web Backend
Commits
bc5ba794
Commit
bc5ba794
authored
1 month ago
by
Charlie Darques
Browse files
Options
Downloads
Patches
Plain Diff
correction de bug : poster un message est possible
parent
2cbd0e29
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
WEB-INF/src/dao/UserDAO.java
+4
-3
4 additions, 3 deletions
WEB-INF/src/dao/UserDAO.java
sql/data.sql
+3
-2
3 additions, 2 deletions
sql/data.sql
with
7 additions
and
5 deletions
WEB-INF/src/dao/UserDAO.java
+
4
−
3
View file @
bc5ba794
...
...
@@ -169,11 +169,12 @@ public class UserDAO {
PreparedStatement
ps
=
this
.
con
.
prepareStatement
(
"INSERT INTO msg (userID_msg, threadID, msg, posted_at) VALUES(?, ?, ?, ?)"
);
try
{
System
.
out
.
println
(
"dans le try de post message"
);
ps
.
set
String
(
1
,
""
+
user
.
getId
());
ps
.
set
Int
(
1
,
user
.
getId
());
// PROBLEME ICI
ps
.
set
String
(
2
,
""
+
thread
.
getId
());
ps
.
set
Int
(
2
,
thread
.
getId
());
ps
.
setString
(
3
,
message
);
ps
.
setString
(
4
,
"TO_DATE("
+
LocalDate
.
now
().
toString
()
+
", 'YYYY/MM/DD')"
);
Date
date
=
Date
.
valueOf
(
LocalDate
.
now
());
ps
.
setDate
(
4
,
date
);
System
.
out
.
println
(
ps
);
ps
.
executeUpdate
();
}
...
...
This diff is collapsed.
Click to expand it.
sql/data.sql
+
3
−
2
View file @
bc5ba794
...
...
@@ -17,11 +17,12 @@ INSERT INTO follow VALUES (2,1, TO_DATE('11/02/2025', 'DD/MM/YYYY')),
(
1
,
4
,
TO_DATE
(
'20/09/2025'
,
'DD/MM/YYYY'
));
INSERT
INTO
msg
VALUES
(
3
,
1
,
'Bonjour !'
,
TO_DATE
(
'11/02/2025'
,
'DD/MM/YYYY'
)),
INSERT
INTO
msg
(
userID_msg
,
threadID
,
msg
,
posted_at
)
VALUES
(
3
,
1
,
'Bonjour !'
,
TO_DATE
(
'11/02/2025'
,
'DD/MM/YYYY'
)),
(
4
,
1
,
'Hello !'
,
TO_DATE
(
'18/02/2025'
,
'DD/MM/YYYY'
)),
(
1
,
3
,
'Mon objet était ici.'
,
TO_DATE
(
'02/02/2025'
,
'DD/MM/YYYY'
));
INSERT
INTO
reactions
VALUES
(
2
,
1
,
'TRUE'
),
INSERT
INTO
reactions
VALUES
(
2
,
2
,
'TRUE'
),
(
4
,
3
,
'FALSE'
),
(
3
,
3
,
'TRUE'
);
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment