106
Views
3
Comments
Retrieve data from JSON file into Database

Hello All,

I have a JSON file to which I want to extract in my database. there are many attributes in that file and I want that all the record should store in my database.

I'm confused about creating a entity and fill attributes which I dont know at all.

When I loaded the json file in the structure many entities were created which confused me more.

How to do that can anyone help me.

I have a Json file which is not sharable in public.

these type of structures were created and there are many more.

My main objective is to store data in database from that json file (I don't know what to do I am at 0)

I also tried to use JSON deserialize to get but got stuck there also.

Please Help. 

Thank you.

UserImage.jpg
vikas sharma
Champion

Hi Dev,

If number and type of attributes are not fixed in json then how you can create a entity for those attribute? so if json is not fix I would suggest to store that json content as text in the database.

If fields are fixed, then you can create a corresponding structure and use json deserialize to get the data. Of course if its a complex json then many structures will be created. But all will be nested in a single outer structure.

regards

UserImage.jpg
Dev Limbachia

Hello Vikas,

I've never worked on JSON or Java.

I have a single JSON file, can you tell me how to get to know which are entities and attributes in that file?

And for json serialize also, I need the entity to store which I don't know what to create.

I got a request to store json data in the database but how that I don't know :(

UserImage.jpg
vikas sharma
Champion

Hi,

You can read the file content as simple text and then store it in database.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.