Join Tables 1

In this example we are extracting information from three Tables: employees, landlines, and mobile. Please note that the landline and mobile numbers are all fictional. We remind you that any data you enter into the database will be removed at the end of your Session. Please refer to tabs JavaScript and JSP to see how we are able to reference the fields from tables landlines and mobile. Since we are returning a JSON string to the client side, all fields within a join will appear as an object. For the fields in tables landlines and mobile the returned objects look like so:

"landlines":{"number":"555-4321"},"mobile":{"number":"444-0085","type":"cell"}

Thus, in our JavaScript we refer to the employee's landline number as: landlines.number using dot notation.
The same is true for the fields in the mobile table: mobile.number and mobile.type.

To join the tables landlines and mobile with table employees in the JSP file, we use the Join class. There are two seperate Joins in this example. One for each table landlines and mobile. The appropriate fields are created within each Join and each Join is added to the instance of the Editor class.

@see Join Tutorial 1 for more information

Live example


FIRSTNAME LASTNAME LANDLINE MOBILE NUMBER MOBILE TYPE
Loading data from server
FIRSTNAME LASTNAME LANDLINE MOBILE NUMBER MOBILE TYPE


Javascript
HTML
Java
Includes