Open jiuntian opened 3 years ago
Hi there, I am using MySQL as my data storage.
Can I modify the json file (https://jiuntian.com/data.json) from this link to suit the implementation of jdbc? I would retain the same information but with different implementation.
You do not have to modify the JSON structure to store the data in SQL databases. Store each class of object in one table and reference by primary and foreign key. You can write your own function to insert the entries to database, but you can also use libraries like Hibernate or JPA to ease your work.
Some resources: https://www.javatpoint.com/hibernate-tutorial https://docs.jboss.org/hibernate/orm/current/quickstart/html_single/ https://www.tutorialspoint.com/hibernate/index.htm
Since Database Management System course might not been taken by first year student, I include some of the resource just in case. Brief introduction to database: http://www.upi.pr.it/docs/easfg/easvrfgp7.htm
Since External Database is part of extra requirements, we want you to show your extraordinary in getting A+. However, you can also try NoSQL database like mongodb, which will be easier to deal with JSON as it store data as document (JSON).
You can modify JSON structure to add feature, but not this.
Hope this helps. Good luck in learning in modern Java Programming. Feel free to ask if any further questions or difficulties.
On Sun, May 16, 2021, 4:52 PM shenshen1122 @.***> wrote:
Hi there, I am using MySQL as my data storage.
Can I modify the json file (https://jiuntian.com/data.json) from this link to suit the implementation of jdbc? I would retain the same information but with different implementation.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jiuntian/IssueTrackerAssignment/issues/4#issuecomment-841788386, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADJ2E72EV3UYMQRNXBOJ7MTTN6BVJANCNFSM445SHXFA .
Hi there, I misspoke in the earlier comment. What I meant is given that I will be referencing primary key with foreign key in tables in database. Can I change the the "name of the attribute" without altering the "value" in json file.
For example the changes in (issue) "id" -> "issueID"
I will also add "projectID" - to reference PK in project table "creatorID" , "assigneeID" - to reference PK in user table
Are the above changes in json file allowed?
Can
Good day, I wanna to ask about the database, is that an extra features or not? Cause in the question said that "Your program should at least be able to read the provided initial data into your own local database.".
Hi,
"Your program should at least be able to read the provided initial data into your own local database."
This mean that, your problem should at least, be able to read the data.json, and made changes/update to it, as a local file database.
While the external database, like MySQL, will be a part of extra requirement, which will bring extra values to your work.
Just want to confirm with you, the local file database meaning that we can write it into .txt or .csv right?
json
On Wed, May 19, 2021, 10:59 AM Terence440 @.***> wrote:
Just want to confirm with you, the local file database meaning that we can write it into .txt or .csv right?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jiuntian/IssueTrackerAssignment/issues/4#issuecomment-843706073, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADJ2E76KILNIGNKXJPXSTGLTOMSQZANCNFSM445SHXFA .
alright thank you
Good day, just want to ask about the time stamp. In the data.json it showing this kind of time stamp -> "timestamp": 1567340520 Can we write into another form like -> Sat May 22 23:47:16 MYT 2021
is there problems to parse and write in UNIX timestamps?
I got it, thank you @jiuntian .
JSON is JavaScript Object Notation. It is actually a Map data structure to store the data, with key value pair. Each JSON object is a Map<String, Object> object, where Object can be any class that is suitable.
For example you have a Class Person, where it's attribute is name, age; and a House class with its attribute persons, which is a List.
and then your json file
grayhouse.json
could be like this:What you should do to parse the json file is to:
grayhouse.json
into an House object, and multiple Person object in the List in House.Your code should be able to Deserialise (read object into Java Object from json string), and Serialise (write Java Object into json string, which mean u save all your data into Json file as a file database).
You should did Google Search when you are encountering problem, before start to ask demo, as one of the learning objective of this assignment is problem solving skill. However, don't be hesitate to ask demo if you have any problem that cannot be solved by using Google Search.
Some resources you may refer to:
json deserialization/serialization
Thanks.