Using the Database

You can use any database implementation to save real-time events. The default is an in-memory database provided by Hypersonic (HSQL).

To change the database implementation, add a new data provider in the Data Provider window under Server in the iWay Service Manager Administration Console, as shown in the following image.

Follow the instructions in the window to add a new database and test its connection.

When writing an iWay Functional Language (iFL) expression for a tap, supply the name of the data provider that you created for the database implementation, instead of supplying the value DB.

You can use many data providers and events that persist in different databases. iWay Enable has the ability to aggregate event data across multiple databases.


Top of page

Example: Overriding SQL Statements

iWay Enable uses a set of SQL calls to capture and query event data. Some databases require the native syntax when creating tables or updating or querying data.

The following is a sample properties file named enable.properties. The file overrides key SQL words so that iWay Enable can work properly with the database.

Important: Make sure that the enable.properties file is included in the Classpath for iWay Service Manager.

#THIS SECTION IS AN EXAMPLE OF HOW TO
#OVERRIDE DATATYPES AND TABLE CREATION
#WHEN USING AN ORACLE DATA PROVIDER WHOSE
#ALIAS IS NAMED ora
#---------------------------------------
#OVERRIDE THE DOUBLE DATATYPE
ora.double=decimal 
#OVERRIDE STRING DATATYPE
ora.string=VARCHAR (256) 
#OVERRIDE CREATION OF EVENT TABLES
ora.ddl=CREATE TABLE ? ( "TIME" TIMESTAMP NOT NULL, "VALUE" ? ) 
#OVERRIDE THE TABLE CREATION ERROR HANDLING BY PROVIDING
#THE ERROR CODE FOR TABLE EXISTS
ora.existscode=955
#THIS SECTION IS AN EXAMPLE OF HOW TO
#OVERRIDE DATATYPES AND TABLE CREATION
#WHEN USING A SYBASE DATA PROVIDER WHOSE
#ALIAS IS NAMED jconn3
#---------------------------------------
#OVERRIDE THE TABLE CREATION ERROR HANDLING BY PROVIDING
#THE ERROR CODE FOR TABLE EXISTS
jconn3.ddl=CREATE TABLE ? ( "TIME" SMALLDATETIME NOT NULL, "VALUE" ? ) 
#OVERRIDE STRING DATATYPE
jconn3.string=VARCHAR (254) 
#OVERRIDE THE DOUBLE DATATYPE
jconn3.double=decimal 
#OVERRIDE THE TIMESTAMP DATATYPE
jconn3.timestamp=SMALLDATETIME 
#OVERRIDE THE TABLE CREATION ERROR HANDLING BY PROVIDING
#THE ERROR CODE FOR TABLE EXISTS
jconn3.existscode=2714
 
#THIS SECTION IS AN EXAMPLE OF HOW TO
#OVERRIDE DATATYPES AND TABLE CREATION
#WHEN USING AN ORACLE JDBC DRIVER
#---------------------------------------
#OVERRIDE THE DOUBLE DATATYPE
oracle.jdbc.driver.OracleDriver.double=decimal 
#OVERRIDE CREATION OF EVENT TABLES
oracle.jdbc.driver.OracleDriver.ddl=CREATE TABLE ?
      ( "TIME" TIMESTAMP NOT NULL, "VALUE" ? ) 
#THIS SECTION IS AN EXAMPLE OF HOW TO
#OVERRIDE DATATYPES AND TABLE CREATION 
#WHEN USING AN SYBASE JDBC DRIVER
#---------------------------------------
com.sybase.jdbc3.jdbc.SybDriver.ddl=CREATE TABLE ?
      ( "TIME" SMALLDATETIME NOT NULL, "VALUE" ? )

iWay Software