Skip to main content Skip to complementary content

Configuring the components

Procedure

  1. Double-click the cSQLConnection component to display its Basic settings view in the Component tab.
  2. Configure the properties as follows:
    1. In the Driver Class field, enter the class name for the H2 database, "org.h2.Driver".
    2. Click the [+] button under the Driver JAR table to add a row.
    3. Select the cell and click the [...] button at the right side of the cell to open the Module dialog box.
    4. Click the Platform option and select the driver JAR h2-2.1.214.jar from the list.
    5. Click OK to close the Module dialog box.
    6. In the JDBC URL field, enter the JDBC URL of the database to be used, "jdbc:h2:tcp://localhost/~/test" in this example.
    7. Select the Authentication check box and enter the database user authentication data.
  3. Double-click the cTimer component in the first subRoute, to display its Basic settings view in the Component tab.
  4. Set the values for the Period (500), Repeat (1) and Delay (100) fields as shown above to trigger a message exchange after a delay of 100 milliseconds in the first subRoute.
  5. Repeat this step to configure the other two cTimer components to trigger three message exchange after a delay of 500 milliseconds every 500 milliseconds in the second subRoute and one message exchange after a delay of 3000 milliseconds in the third subRoute.
  6. Double-click the cSQL component in the first subRoute to display its Basic settings view in the Component tab.
  7. In the Datasource list, select cSQLConnection_1 to use the database connection established in it. In Query box, enter the following code to create a TEST_TABLE of four columns ID, Firstname, Lastname, and RegisterDate DATE in the database:
    "CREATE TABLE IF NOT EXISTS  TEST_TABLE (
      ID INTEGER auto_increment NOT NULL,
      Firstname VARCHAR(25),
      Lastname CHAR(25) NOT NULL,
      RegisterDate DATE DEFAULT CURRENT_TIMESTAMP,
      PRIMARY KEY (ID)
    )"
  8. Double-click the cSetBody component to display its Basic settings view in the Component tab.
  9. Select Constant in the Language list and enter "INSERT INTO TEST_TABLE (Firstname, Lastname) VALUES ('Mike', 'Jonson')" in the Expression field.
  10. Double-click the cSQL component in the second subRoute to display its Basic settings view in the Component tab.
  11. Select cSQLConnection_1 in the Datasource list and select the Use SQL statement from message body check box.
  12. Double-click the cSQL component in the third subRoute to display its Basic settings view in the Component tab.
  13. Select cSQLConnection_1 in the Datasource list and enter "select * from TEST_TABLE" the Query box.
  14. Double-click the cLog component in the first subRoute, to display its Basic settings view in the Component tab.
  15. Configure the properties as follows:
    1. Select the Format the log output option.
    2. In the Arguments table, click [+] to add two rows and enter "multiline" and "showheaders" in the Name field. In the value field, enter true for both the two arguments.
    3. Keep the default settings of the other options.
  16. Repeat this step to configure the other two cLog components in the same way.
  17. Press Ctrl+S to save your Route.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!