r/programmingrequests • u/KableIV • May 18 '18
Help needed with taking fetched data from API and inserting into MYSQL Database
LINK to Github(Keys and passwords obv. left out/removed): https://github.com/kableiv/GET-from-API-insert-into-Database
In my TEST method in the class GodaddyGET, I am putting in a GET request for all my domains on my Godaddy account, and getting a response. In the method I assign the values to objects one by one in a foreach loop what I wanna do at the end of the loop, is add the said data into my MYSQL Database, in the respective collumns.
How can I go about this, can anyone help?
2
Upvotes
3
u/IcyTv May 18 '18
Get a java sql library and add the data while running through the for loop
2
u/InterestedListener May 18 '18
https://stackoverflow.com/questions/18270414/inserting-records-into-a-mysql-table-using-java?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
That StackOverflow post has some code you can adopt for your purpose.