Avatar of Omer-Pitou
Omer-Pitou

asked on 

MySQL: Upload a JSON file into a table programmatically

Hi
Does anymore know about a technique, a tool or set of commands to load a JSON file into a mysql table. Please, note fields will match with the JSON structure.
I know I can do it in MySQL Workbench, but I want to automate the process.

Thanks
MySQL ServerJava

Avatar of undefined
Last Comment
James Bilous
SOLUTION
Avatar of James Bilous
James Bilous
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Omer-Pitou
Omer-Pitou

ASKER

Thanks James,
What I am avoiding is to loop through these rows.
I think I will convert it to CSV, and load it with MySQL LOAD INFILE
Avatar of James Bilous
James Bilous
Flag of United States of America image

In that case there are online converters that will get you from json to csv that you can fin pretty readily via Google search.
Avatar of Omer-Pitou
Omer-Pitou

ASKER

Do you know any 3rd party library that I can embed into the app
Avatar of James Bilous
James Bilous
Flag of United States of America image

What exactly are you doing? You didn't really give a lot of context to your problem. You're making an android app that receives JSON and you want to put it into a database by converting it to CSV first? This seems to be the most round about and difficult way to do this. Why not just use all the tools and APIs available from the Android Developmen toolkit that were made for this exact purpose?
Avatar of Omer-Pitou
Omer-Pitou

ASKER

I am not developing an Android app.
It is a SE app which will in a local network.
Some of the data need to be transferred to a remote database (web server) to serve the web dashboard application. This will be done through a web service.
ASKER CERTIFIED SOLUTION
Avatar of James Bilous
James Bilous
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Java
Java

Java is a platform-independent, object-oriented programming language and run-time environment, designed to have as few implementation dependencies as possible such that developers can write one set of code across all platforms using libraries. Most devices will not run Java natively, and require a run-time component to be installed in order to execute a Java program.

102K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo