Header Ad

Showing posts with label json. Show all posts
Showing posts with label json. Show all posts

Wednesday, April 4, 2012

How to read JSON data using Java


This article will help how to read JSON using java program. By using "JSON-lib" library we can read JSON data.

The following link will provide a detailed explanation about how to use "JSON-lib"

Thank you.

Tuesday, April 3, 2012

Introduction to JSON


JSON( Java Script Object Notation) is a lightweight data interchange format. It is easy to parse and generate. JSON format is completely language independent. But uses conventions that is easy for programmers.

JSON is built on two structures:
  • A collection of name/value pairs.
  • An ordered list of values. Like an array, List, or sequence.

The following sample JSON format. We can easily retrieve the values of below JSON by using keys.
{
      "id": 1,
      "name": "John",
      "designation": "SE"
}

The following is the sample example for LIST of values.

{
  "employees":
  [
    {
      "id": 1,
      "name": "John",
      "designation": "SE"
    },
    {
      "id": 2,
      "name": "Smith",
      "designation": "SE"
    }
  ]
}