HomeНаука и техникаRelated VideosMore From: Dan Vega

How to read JSON data in Spring Boot and write to a database

159 ratings | 18958 views
Enroll in my Spring Boot Course http://bit.ly/2pQuyFq In this tutorial, we are going to look at how to read JSON data in a Spring Boot application and write it to a database. Source Code: https://github.com/cfaddict/spring-boot-jsontodb Please Subscribe to this channel and leave a comment below. Blog: http://therealdanvega.com/blog Facebook: http://www.facebook.com/therealdanvega Twitter: http://www.twitter.com/therealdanvega
Html code for embedding videos on your blog
Text Comments (24)
mudassir niyazi (11 days ago)
Can you make a background white not able to see properly
Eleftherios Fadakis (15 days ago)
Hi Dan, thanks for the video but it seems I am facing an issue. When I run the app I get this "Unable to save users: Unrecognized field "id" (class com.therealdanvega.domain.User), not marked as ignorable (0 known properties: ]) at [Source: [email protected]; line: 3, column: 12] (through reference chain: java.util.ArrayList[0]->com.therealdanvega.domain.User["id"])" I went to your git repository and downloaded your project and I still get the same message. I see in Users.java you import "com.fasterxml.jackson.annotation.JsonIgnoreProperties" Do you use it somehow and I missed it? Although both inputStream and typeReference are not null when the line "List<User> users = mapper.readValue(inputStream, typeReference);" is executed it throws an exception. Thank you for your time.
Eleftherios Fadakis (15 days ago)
If I add in the mail class " mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);" I get the "Users saved!" message but then the "http://localhost:8080/users/list" returns: "[{},{},{},{},{},{},{},{},{},{}]"
eimaisklhros (1 month ago)
hi Dan great job. This was a simple Json from a file. But I want to consume an open weather API which gives you a key. How should I manage the key? where do I store it etc? simple storing, no need for security concepts yet. thank you.
Laharnaman (2 months ago)
Hey Dan! Yet another bulls-eye. Right on target for the kind of thing developers have to do on a regular basis. This kind of use-case / cook-book approach is super useful. You might already have this but would be good to see this exact scenario in a modern unit-testing framework like RestAssured -- or whatever you see as trending in the unit-testing world.
nullternative (3 months ago)
20:00 intellij being an ahole using wildcard imports.
MOHAMMAD IMTEYAZUL HAQUE (3 months ago)
Thanks and good example can i have source code of this video
CODEMIX With Masha (3 months ago)
if anyone has error with save List<User> method, change it to saveAll
Soumendra Sanyal (4 months ago)
Can you please help me to exchange some information between two servers
Dan Vega (4 months ago)
+Soumendra Sanyal Sounds like a REST API to me. Check out Spring Boot, easy way to stand up an API REST endpoint for your customer to hit and then you can send back a response.
Soumendra Sanyal (4 months ago)
I need to make an framework where I need to accept some data from customer and i.e. receive information and make a normal response to that received signal
Dan Vega (4 months ago)
Yes. What have you tried so far, what is the issue you're having?
Enrico Giurin (5 months ago)
interesting, but it takes too long before get to the point, which is to read/write json in a DB
Swedha Selvaraj (5 months ago)
hi...could you tell me how to convert csv to json and insert that jason file into couchdb using springboot
Mickey Mouse (6 months ago)
Thank u so much
Abhi Chunchu (8 months ago)
How to read json data and perform Mathematical Operations ( Addition, Multiplication, etc) to data and emit the results as new json data. Small example with basic operation would be really helpful to me. Thank you
Zakaria Abdi (1 year ago)
Thanks, am loving your Udemy classes. well deserved 5-star rates
Amazing, keep it up!
ken macpherson (1 year ago)
Always good stuff. The @bean CommandLineRunner in Application Class was pretty cool, apparently that gets run after all the Spring beans are created and context is created. It basically does a shell .run(args), pretty cool way of doing a poor man's Spring Boot bootstrapping like Grails? Is that new or specific to Boot 1.5? Thanks.
Thanks a lot, you very good speaker. Good luck.
Met Met (1 year ago)
best spring boot tuts
Dan Vega (1 year ago)
Thank you!
briangbhawaii (1 year ago)
Great job. Also enjoying your Udemy Course as well.
Dan Vega (1 year ago)
Thank you!

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.