Solved

Can I import JSON file into MySQL?

Posted on 2011-03-08
8
4,448 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

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
 
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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Weekend adv creator 3 38
xampp tool 12 50
Could you point what is avoiding the PHPExcel library to fill the sheet? 8 36
How to determine if a string is a valid SHA value 7 33
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This video teaches viewers about errors in exception handling.

772 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