Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Install the MySQL server.
  2. Download the JDBC driver for MySQL from here and copy it to your <EI_HOME>/lib directory.

    Note
    If the driver class does not exist in the relevant folders when you create the datasource, you will get an exception such as 'Cannot load JDBC driver class com.mysql.jdbc.Driver'.
  3. Create the following database: Employees
  4. Create the Employee table inside the Employees database:

    Code Block
    CREATE TABLE Employees (EmployeeNumber int(11) NOT NULL, FirstName varchar(255) NOT NULL, LastName varchar(255) DEFAULT NULL, Email varchar(255) DEFAULT NULL, Salary varchar(255));

...

GET data

...

using JSON

...

A data service can expose data in one of the following formats: XML, RDF, or JSON. You can select the required format by specifying the output type for the data service query. To expose data in JSON, you need to select JSON as the output type, and map the output to a JSON template. 

...

You will receive the response in JSON format.

...

POST/UPDATE data using JSON

When a client sends a request to change data (POST/PUT/DELETE) in the datasource, the HTTP header "Accept" should be set to "application/json".  Also, if the data is sent as a JSON payload, the HTTP header "Content-Type" should be set to "application/json".

...