Author | Message |
---|---|
ifiguer
Posts: 27
|
Posted 18:02 Apr 26, 2018 |
Hey everyone. Just posting this to see if someone could guide in the right directions. I've been trying many different methods of converting a string to a Date, but one seem to work. Does any one have any hints. I have tried SimpleDateFormat fyi.
|
maguil53
Posts: 5
|
Posted 18:31 Apr 26, 2018 |
This is what I did and my code seems to work fine (make sure to catch the ParseException thrown by the SimpleDateFormat object's parse() method): SimpleDateFormat format = new SimpleDateFormat("M/d/yyyy"); java.util.Date util_Date = format.parse( dateString );
Also, note that a "java.util.Date" object is different from a "java.sql.Date" object. We need the latter to update our table. Here's the link to the documentation for java.sql.Date: https://docs.oracle.com/javase/8/docs/api/java/sql/Date.html |
ifiguer
Posts: 27
|
Posted 21:45 Apr 26, 2018 |
Thanks for the help. Do you know if we need to have a table of users with both administrators and users? Where administrators only have access to operations, or do we assume there are only administrators in the database? |
cysun
Posts: 2935
|
Posted 21:58 Apr 26, 2018 |
There are only administrators (i.e. librarians). |
epascua
Posts: 47
|
Posted 22:56 Apr 26, 2018 |
Hello! Do the administrators only have the ability to return an item? Edit: Just a bit confused cause you have "users", then "authenticated users", on #1 you state that authenticated users can perform operations such as edit and checkout. Then on #2 it is stated that a user can click on checkout (as if all users and not only authenticated users can click checkout). Then on #3, it says users again. So I'm not sure if for #3 it's only authenticated users or just regular users. Overall, I'm not sure if I'm overthinking it. My finished homework has the return, edit, and checkout operations only for authenticated users. Is that the right way to go? Last edited by epascua at
23:16 Apr 26, 2018.
|
wcwir
Posts: 75
|
Posted 23:47 Apr 26, 2018 |
The specification is not clear, but it makes sense that only librarians should be able to mark an item as returned. Otherwise, a lot of the items might go missing, or someone might just mess with the records because they can. |
cysun
Posts: 2935
|
Posted 09:56 Apr 27, 2018 |
I recently read a joke about programmers which I thought was pretty funny. A programmer got a call from his wife, and she said "after you get off work, buy a pound of dumplings. If you see the guy selling watermelons, buy one". Later the programmer got home and handed his wife one dumpling. His wife asked why he only bought one dumpling, he said "I saw the guy selling watermelons". |
wcwir
Posts: 75
|
Posted 14:58 Apr 27, 2018 |
My husband really appreciated this, as we often find ourselves in similar situations. |