简体   繁体   中英

Storing JSON data into MySQL database

I am having a JSON file with multiple and multi-level data. Now I want to store this data into MySQL database. I searched many links but didn't suit to my data and none of it helped me.

My JSON data: http://fiddle.jshell.net/4QNYk/

I am new to JSON and Java. Please help me out.

Depending on what you want to do later with the JSON, storing it as a normal text seems to be the best idea on MySQL at the moment. Other DBMS like PostgreSQL are having some datatype for JSON -- but assuming you having you application magic at Java-side and not wanting to start fuzzying around with the JSON on database layer, text is totally fine.

Of course, if you want to search inside the JSON it's maybe not the best way of storing them. But as mentioned in the comments, there are other DBMS are better choice.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM