Solved

Can I import JSON file into MySQL?

Posted on 2011-03-08
8
4,131 Views
Last Modified: 2012-05-11
Hi,
I have a file in the JSON format which I need to import to mysql. Is there a way I can directly import the file to mysql using Java or do I need to convert it to xml first?

Thanks.
0
Comment
Question by:orazen12
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 35068436
Your best best is to convert it to java objects and then do an update
0
 
LVL 20

Assisted Solution

by:a_b
a_b earned 150 total points
ID: 35068441
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35068526
It might be a good idea to post an example of something you want to import
0
 

Author Comment

by:orazen12
ID: 35068717
CEHJ,
The data is as below:

{    "glossary": {     "title": "example glossary",            "GlossDiv": {            "title": "S",                  "GlossList": {                "GlossEntry": {                    "ID": "SGML",                              "SortAs": "SGML",                              "GlossTerm": "Standard Generalized Markup Language",                              "Acronym": "SGML",                              "Abbrev": "ISO 8879:1986",                              "GlossDef": {                        "para": "A meta-markup language, used to create markup languages such as DocBook.",                                    "GlossSeeAlso": ["GML", "XML"]                    },                              "GlossSee": "markup"                }            }        }    }}
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 3

Expert Comment

by:ss_p
ID: 35069710
crate java objects
0
 
LVL 3

Expert Comment

by:ss_p
ID: 35069714
create java objects
0
 
LVL 92

Accepted Solution

by:
objects earned 350 total points
ID: 35074556
this will handle reading the json
http://code.google.com/p/google-gson/

you can then use jdbc to update the database
0
 

Author Closing Comment

by:orazen12
ID: 35128580
Thanks.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
The viewer will learn how to implement Singleton Design Pattern in Java.
This video teaches viewers about errors in exception handling.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now