JSON Tutorial Part-5 | How To Read Data from JSON File in Java | JSON Simple API

Поділитися
Вставка
  • Опубліковано 7 січ 2020
  • Topics :
    ------------
    1) How To Read Data from JSON File in Java
    2) JSON Simple API
    JSON Used:
    --------------------
    {
    "firstName": "John",
    "lastName": "Kennedy",
    "address": [
    {
    "street": "abc",
    "city": "Hyderabad",
    "state": "TL"
    },
    {
    "street": "xyz",
    "city": "Chennai",
    "state": "TN"
    }
    ]
    }
    #########################
    Udemy Courses:
    #########################
    Manual Testing+Agile with Jira Tool
    ************************************
    ► shorturl.at/xNXZ4
    Selenium with Java+Cucumber
    ********************************
    ► shorturl.at/aIKMW
    Selenium with Python & PyTest
    ********************************
    ► shorturl.at/ELW09
    Selenium with python using Robot framework
    ****************************************
    ► shorturl.at/bcDPZ
    API Testing(Postman, RestAssured & SoapUI)
    *****************************************
    ► shorturl.at/uAWY7
    Web & API Automation using Cypress with Javascript
    ********************************************
    ► rb.gy/4uum2n
    Playwright with Javascript
    **************************
    ► shorturl.at/gALZ1
    Jmeter-Performance Testing
    ************************
    ► rb.gy/ocj7r2
    SDET Essencials(Full Stack QA)
    *************************
    ► rb.gy/hlnf2v
    Appium-Mobile Automation Testing
    ************************************
    ► rb.gy/wmzv64
    Java Collections
    *****************
    ► bit.ly/3S66ezE
    Python Programming
    *********************
    ► urlis.net/gdsfpb0s
    Cucumber BDD Framework
    ***************************
    ► bit.ly/3F7d69r
    Protractor with Javascript
    ***************************
    ► urlis.net/4uddm1qb
    ####################################
    UA-cam Playlists:
    ####################################
    Manual Testing & Agile
    ***********************
    ► bit.ly/3ujvaYa
    ► bit.ly/3OYzxQj
    SQL
    *************************
    ► bit.ly/3R6XjeG
    ► bit.ly/3nE0a1s
    ► bit.ly/3IeKuuJ
    linux & Shell Scripting
    **********************
    ► bit.ly/3up1Z6a
    ► bit.ly/3nzvGxx
    Java
    **********************
    ► bit.ly/3R9QfOs
    ► bit.ly/3AoRMKM
    ► bit.ly/3IbTTDn
    ► bit.ly/3ybXInv
    ► bit.ly/3yCoHdw
    Selenium With Java+Cucumber
    ********************************
    ► bit.ly/3P2FMm4
    ► bit.ly/3yhiIt4
    ► bit.ly/3uokzet
    ► bit.ly/3a7XIND
    ► bit.ly/3umN2S9
    ► bit.ly/3aar7GW
    ► bit.ly/3y9kD2S
    ► bit.ly/3uhLskn
    Python
    ********************************
    ► bit.ly/3agNgU0
    ► bit.ly/3NJNnoy
    ► bit.ly/2CTQ4mR
    ► bit.ly/3OIYWh1
    Selenium With Python,Pytest&Behave
    ***************************************
    ► bit.ly/3OHHoC9
    ► bit.ly/3IeNLdv
    ► bit.ly/2J4tPeT
    ► bit.ly/3ydSkAq
    Selenium With Python Using Robert Framework
    (Web&API Testing)
    *************************************************
    ► bit.ly/3nUvlpr
    ► bit.ly/3nUvE3z
    API Testing (Postman,SoapUi,&Rest Assured)
    **********************************************
    ► bit.ly/3OXacWY
    ► bit.ly/3yh0UhE
    ► bit.ly/3nC9DWQ
    ► bit.ly/3yGfhNS
    ► bit.ly/3OJa11H
    ► bit.ly/3P2slCC
    Mobile App Testing Appium
    ****************************
    ► bit.ly/3Al49HG
    Performance Testing Jmeter
    *******************************
    ► bit.ly/3nz4fE7
    Maven,Jenkins,Git,Github,CI/CD
    *******************************
    ► bit.ly/3P16HPj
    ► bit.ly/3yhlUVA
    ► bit.ly/3afYfwT
    ► bit.ly/3yGzweG
    ► bit.ly/3yF73Ws
    ► bit.ly/3NCOmH7
    SQL,DB Testing&ETL,Bigdata
    *******************************
    ► bit.ly/3NKOcNY
    ► bit.ly/3OVpDyI
    ► bit.ly/3NEvUy0
    ► bit.ly/3IryxlT
    ► bit.ly/3RkWBLh
    JavaScript Based Automation Tools
    ********************************
    ► bit.ly/3nUx51X
    ► bit.ly/3AqI6Q0
    ► bit.ly/3yeurbT
    ► bit.ly/3ujzpTK
    Selector Hub Tools
    ********************
    ►rb.gy/h3h424
    GraphQL
    ******************
    ► rb.gy/sj3gys
    Cypress API Testing
    ********************
    ► shorturl.at/fjKPX
    Cypress Web Testing
    **********************
    ► shorturl.at/agjlK
    Playwright with Javascipt
    **************************
    ► shorturl.at/adSTY
    #JSONParsingJava
    #JavaJSONReading
    #JSONFileHandling
    #JavaFileIO
    #JSONDataExtraction
    #JSONDataManipulation
    #JavaDataParsing
    #JSONParsingTutorial
    #JavaJSONExamples
    #JSONReadCode
    #JavaProgramming
    #JSONDataProcessing
    #JavaTipsAndTricks
    #JSONDataAccess
    #JavaFileHandlingTips
    #JSONDataExploration
    #JavaProgrammingTutorial
    #JSONReadingMethods
    #JavaJSONParsingDemo
    #JSONFileOperations
    #JavaIOExplained
    #JSONParsingTechniques
    #JavaFileReadTutorial
    #JSONDataFetching
    #JavaJSONReadingGuide
    #JSONParsingBestPractices
    #JavaFileManipulation
    #JSONDataVisualization
    #JavaCodingSkills
    #JSONParsingWalkthrough
    #JavaFileIOTricks
    #JSONDataAnalysis
    #JavaJSONHandsOn
    #JSONParsingStepByStep
    #JavaFileReadExamples
    #JSONDataTransformation

КОМЕНТАРІ • 116

  • @FourAlexia
    @FourAlexia 2 роки тому +1

    Thank you! Excellent tutorial, getting back in the groove of Java syntax.

  • @Arnatore
    @Arnatore 4 роки тому +7

    Thank you a lot sir, this is exactly what I was looking for.

  • @hemantsahu4100
    @hemantsahu4100 Рік тому +2

    sir thankyou so much sir what a super content for JSON java there is no such content on youtube like your thankyou thankyou so much sir

  • @kiranrao7429
    @kiranrao7429 4 роки тому

    Hello sir,
    I never comment here, but you made me to do today
    That was very clear explanation

  • @arianetrek7049
    @arianetrek7049 7 місяців тому +2

    Thak you for the complete tutorial about JSON, and kudos for the easy to understand examples shown !

  • @kumarmangalam6267
    @kumarmangalam6267 2 роки тому +1

    Can you please explain what if at line 24, there is again JSON object. (inner JSON). I created a another object for inner JSON from outer one but that doesn't seem to work.

  • @ankitshrivastava1772
    @ankitshrivastava1772 3 роки тому +1

    Thanks, Sir for this video. Here we are values from the JSON one by one that we can do from the property file as well, is there any way so that we can parse the whole JSON file directly instead of reading single-2 values from the JSON, please make a video for the same.

  • @Sansysofancy
    @Sansysofancy 3 роки тому +2

    LIFE SAVER! Thank you sir!

  • @himanshubagga6924
    @himanshubagga6924 3 роки тому +1

    Thank you for the wonderful video.

  • @dipeshrverma
    @dipeshrverma 3 роки тому +1

    Awesome... I have learned complete automation by just your video... You are awesome

  • @hrithikmohan5948
    @hrithikmohan5948 2 роки тому +1

    Very useful.. Thanks a lot ! 👍🏻

  • @kapilkaushal6178
    @kapilkaushal6178 2 роки тому

    Great explanation.... Can you please advise if I need to filter the data in json then how can I do that. For ex. In my json I have key as severity and value as critical. Hence I need to filter out only the elements that contains this key value pair.

  • @jnp9155
    @jnp9155 2 роки тому +1

    Thank you sir for this type of video. which helps us to learn in practical way.

  • @sreekanthkanneganti7051
    @sreekanthkanneganti7051 3 роки тому +1

    Clear explanation about reading JSON object and JSON Array

  • @Chunmun897
    @Chunmun897 3 роки тому

    I was looking for it.
    Thanks for great video.

  • @manasipalkar9794
    @manasipalkar9794 3 роки тому

    Hi Sir , I am getting this error
    An internal error occurred during: "Search Marketplace for compatible editors (*.json)".
    I cannot resolve it. My json symbol is of Visual code and not Eclipse as shown in yours.

  • @jb8512
    @jb8512 2 роки тому

    dude, you're the best. thank you so much

  • @mrhedrapt
    @mrhedrapt 2 роки тому +1

    Such a good video! Thank you so much! Saved my User Story

  • @sankeethganeswaran3024
    @sankeethganeswaran3024 3 роки тому

    Thank you very much you are doing a great service.

  • @vivekfirebase4074
    @vivekfirebase4074 2 роки тому

    Explained clearly. thank you for the video❤

  • @shivakumaryennam7530
    @shivakumaryennam7530 3 роки тому +1

    Excellent explanation sir.. I'm looking for this content 🙏

  • @hanshikaavasudevan3873
    @hanshikaavasudevan3873 2 роки тому

    Thanks a lot Sir for amazingly Explaining each line .....

  • @saimaahmad3658
    @saimaahmad3658 3 роки тому +1

    Excellent job! Thank you

  • @nagarajannagarajan2698
    @nagarajannagarajan2698 Рік тому +1

    tnq for the example coding and explanation it very use full to me. tns a lot sir.

  • @surendranathkanchela887
    @surendranathkanchela887 3 роки тому +1

    You solved my problem brother. Thank you :)

  • @ArunS-lb8sc
    @ArunS-lb8sc 3 місяці тому +1

    Good explanation :)

  • @xyzyz25
    @xyzyz25 3 роки тому +2

    Sir, when we just have multiple records in a array without key value assigned to it like "address " then what should we write in place of array.get(what should we write here ) ? Please reply

    • @agon-eery
      @agon-eery Рік тому

      Bot sure if this is still relevant, but do you mean something like, say: ‘ “test”:[obj_1,obj_2] ‘

  • @Cool94_4u
    @Cool94_4u 3 роки тому

    im getting exception for converting Object into JSONObject -> Exception in thread "main" java.lang.ClassCastException: org.json.simple.JSONArray cannot be cast to org.json.simple.JSONObject
    ==== also checked ISONObject accepts map , so hows ur code working? if we are having Object with us? plz help me

  • @sameenap1419
    @sameenap1419 2 роки тому

    Hello sir, I did exactly the same for my java servlet web application to read a json file, but while giving the json file path like this, it shown as file not found exception, Iam using using tomcat server, How to resolve this? kindly help

  • @ArturoBatistute
    @ArturoBatistute 2 роки тому +1

    Thanks a lot ! You save my day!

  • @susmithanc5320
    @susmithanc5320 Рік тому +1

    Thanks sir for posting

  • @yuvrajbaser
    @yuvrajbaser Рік тому +1

    Thank you for this amazing explanation.

  • @lateefjeremiah9099
    @lateefjeremiah9099 8 місяців тому

    Is there a way we can filter the data we want to get? Can we use the dot and bracket notation as it is found in an array?

  • @swapnabhaskaruni9652
    @swapnabhaskaruni9652 Рік тому

    Do you have a video tutorial on integrating testrail with jenkins, by that i mean invoking a jenkins job to run automation test scripts and post back the results to testrail.

  • @042joe
    @042joe 2 роки тому +1

    Hello Sir,
    While trying to excute the code, I am getting org json.simple.JSONObject cannot be cast to org.json.simple.JSONArray.
    Kindly help me to resolve this.

  • @lucaslimf
    @lucaslimf 7 місяців тому +1

    is very nice! thanks for this video Sir

  • @TeachingCodes
    @TeachingCodes 2 роки тому

    Sir itne badhiya video hao bs audio thode increase kardete toh maja aa jata......may gbu you are very great. Thanks for the amaing conent.

  • @sathishvijay3476
    @sathishvijay3476 Рік тому +1

    Clear cut explanation always❤

  • @shaiksuleman3191
    @shaiksuleman3191 4 роки тому

    Crystal Clear Explanation SIr

    • @sdetpavan
      @sdetpavan  4 роки тому

      Thank you for your feedback.

  • @anwarsosko5963
    @anwarsosko5963 3 роки тому

    very helpful, thanks

  • @sebastus27
    @sebastus27 3 роки тому

    Wouldn't it be ok to apply serialization as well?

  • @sureshisoft4555
    @sureshisoft4555 4 роки тому

    hi pavan ..how to Typecast jsonobject ito onto integer...my json file has integer valuew getting error like "Cannot Cast object to int" -int empid=(int) empjsonobject.get("id");

  • @karamalkalash6620
    @karamalkalash6620 2 роки тому +1

    thank you very much

  • @pradeepmatkatte3454
    @pradeepmatkatte3454 2 роки тому +1

    well explained in simple way.

  • @brajray2881
    @brajray2881 4 роки тому +1

    Thanks you so much 😗💓

  • @tasin487
    @tasin487 3 роки тому +2

    Thanks a lot sir

  • @lrpbro6945
    @lrpbro6945 7 місяців тому

    Hi sir, is there any chances of editing the existing data on json file???

  • @sadathossainchowdhury631
    @sadathossainchowdhury631 4 роки тому +2

    Can you put the data(from JSON file) in ArrayList or any other data structure ?

  • @rahadulhaq6387
    @rahadulhaq6387 4 роки тому

    I dont have Malven in eclipse
    How can i do now??

  • @GurudattaPraharaj
    @GurudattaPraharaj 3 роки тому

    thaks, how to update the values from json file and create a post request.

  • @JaswantSingh-di8nu
    @JaswantSingh-di8nu 2 роки тому +1

    Very good tutorial.

  • @ahmadsoffi206
    @ahmadsoffi206 Рік тому

    Thank you, but what if we want to have array of employees, or having multiple employees?

  • @jeremycharpentier3573
    @jeremycharpentier3573 2 роки тому +1

    Thanks for this tutorial

  • @mahasenmohamed1036
    @mahasenmohamed1036 2 роки тому +2

    Thanks, sir. But I am getting an Exception error for" (JSONObject)obj " saying that :
    "class org.json.simple.JSONObject cannot be cast to class org.json.JSONObject (org.json.simple.JSONObject and org.json.JSONObject are in unnamed module of loader 'app')".
    Please help, what should I do?

    • @VrlHtzz
      @VrlHtzz 2 роки тому

      I'm getting Same error have you got the solution?

    • @andyrojhn9235
      @andyrojhn9235 Рік тому

      @@VrlHtzz me too, did you get the solution

    • @VrlHtzz
      @VrlHtzz Рік тому

      @@andyrojhn9235 I actually don't remember now 😅 you can find your solution using chatGPT

    • @hiiamjohnwatchweontv5552
      @hiiamjohnwatchweontv5552 Рік тому

      @@VrlHtzz jokes on me xd

    • @VrlHtzz
      @VrlHtzz Рік тому

      @@hiiamjohnwatchweontv5552 what 🙄

  • @joseramirez-ep8pj
    @joseramirez-ep8pj 2 роки тому +1

    Thank you so much

  • @nrravitej2498
    @nrravitej2498 4 роки тому

    When i create employee.jsom, its coming with icon as {}, but for you it came as circle, why so?

    • @sdetpavan
      @sdetpavan  4 роки тому

      Install "JSON Editor plugin" from Eclipse Market place. You will get circle icon.

  • @pnpcreator
    @pnpcreator 2 роки тому

    Thanks 🙏

  • @santoshdongare8977
    @santoshdongare8977 2 роки тому

    Hello sir can you show how to read data of json file from resources folder in spring boot?

  • @pritisongade846
    @pritisongade846 2 роки тому

    While running the code I am getting exception in thread " main " unexpected character ( c) at position 189

  • @tonygan9332
    @tonygan9332 День тому

    Hi
    Do you have an the Json code

  • @SkAli-ol4hn
    @SkAli-ol4hn Рік тому

    Thank you Sir, my question is- how I get a specific value from JSONArray
    Inside of JSONArray there is a lots of element with same keys but different value example of I need Value Of "Y" from 4th number elements and we Don't know the elements number then ?
    "address": [
    {"x":xyz,
    "Y":abc},
    {"x":xyz,
    "Y":abc
    },
    {"x":xyz,
    "Y":nsmsm
    },
    {"x":xyz,
    "Y":sjksk
    }]

  • @srikanthreddymadi1495
    @srikanthreddymadi1495 2 роки тому

    Will you Please share how to write the same json file using loop

  • @mallikatripathi8031
    @mallikatripathi8031 3 роки тому

    I have one question please help me out
    [
    {
    "claim_id": "44",
    "claim_line": "1",
    "account_id": "444041"
    }
    ]
    I have this body that I have to use in POST request
    please tell me how to do that
    please help me out.

  • @itsmathsforu2980
    @itsmathsforu2980 3 роки тому +1

    Tell me how to change value of json object using java its urgent

  • @prudviraj97
    @prudviraj97 2 роки тому

    Can I write the json data in class?

  • @haripriyaraja1890
    @haripriyaraja1890 Рік тому

    Can u tell me how to read json in c

  • @prioratodikingsbridge1717
    @prioratodikingsbridge1717 6 місяців тому

    I dont know if thats the old version ,but now you CANT not select an archetype

  • @nrravitej2498
    @nrravitej2498 4 роки тому

    please post the josn you use in your example in description

    • @sdetpavan
      @sdetpavan  4 роки тому

      You can check it now. I copied JSON in description.

  • @athulunni5822
    @athulunni5822 4 роки тому

    Can you please explain what parser means and why it is used

  • @vishalmishra1937
    @vishalmishra1937 2 роки тому

    its showing error not foundjsonparser

  • @avishekbehera
    @avishekbehera 4 роки тому

    json simple is too old , it is better to user Gson or Jackson