com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_link3' is unknown.

RDBMS Sample

Relational databases are the most commonly used data sources in data services. This sample uses an embedded H2 database in demonstrating the use of an RDBMS data source with the Data Services Server.

Deploy the sample data service RDBMSSampleService using the steps in Samples Setup . You can run the sample service using the TryIt tool, which is bundled with the WSO2 Data Services Server, or a code-generated java client sample as discussed in the Data Services Clients section.

Samples in this section are based on a database used in a small company that needs to handle its internal affairs. It contains information such as employee and customer records and product details.

Service descriptions

There are separate queries/operations written for specific tasks of the company. The operations implemented in the service are listed below:

  • customersInBoston - Returns all the customers in Boston. This operation is linked to a query, which has the following simple SQL statement, "select * from Customers where city = 'Boston' and country = 'USA'".
  • employeesByNumber - Returns employee details, given the employee number. This is an example of a data service operation which takes in a parameter. The linked query's SQL statement is written in the following way, "select * from Employees where employeeNumber = ?", where the "?" represents the parameter which is defined in the query.
  • customerAddress - Returns the customer's address, given the person's name.
  • productsInfo - This operation lists information on all the products that are produced in the company.
  • setEmployeeSalary - Sets the salary of an employee, given the employee number and the revised salary.
  • setSalaryForEmployees - Sets the given salary to a given set of employees. Here, the usage of array data type is demonstrated where the employee numbers is an INTEGER ARRAY type.
  • incrementEmployeeSalary - Increments the given employee's salary with the given amount.
  • addEmployee - Adds a new employee records with the given information.

See the topics below for samples on a few important RDBMS functionalities:


com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links2' is unknown.