Overview
ADBC is implemented as an Apama adapter that uses the Apama Integration Adapter Framework (IAF) to connect to standard ODBC and JDBC data sources as well as to Apama Sim data sources.
When connected to JDBC or ODBC data sources, ADBC provides access to most open source and commercial SQL databases. With either of these data sources, Apama applications can capture events flowing through the correlator and play them back at a later time. In addition to storing and retrieving event data, Apama applications can store non-event data and execute queries against the data. Dashboards in Apama applications can directly access JDBC and ODBC database data.
An Apama Sim data source is a file with data stored in a comma-delimited format with a
.sim file extension. Apama release 4.1 and earlier captured streaming data to files in this format. The Apama ADBC adapter can read
.sim files but it does not store data in that format. For information on the format of
.sim files, see
Format of events in .sim files.
Apama provides ODBC and JDBC database drivers for the following Apama-certified databases (note, the ODBC drivers are available only for Windows platforms):
DB2
Microsoft SQL Server
Oracle
Using the Apama database drivers eliminates the need to install vendor-supplied drivers. In addition, they are pre-configured so when you select an Apama database driver in an Apama Studio project, the adapter instance is automatically configured with appropriate settings.
The Apama ODBC database drivers are licensed to be used only with the Apama ADBC adapter. The Apama JDBC drivers can be used with any Apama component.
For more information on the supplied database drivers, see the documentation available at apama_install_dir\doc\db_drivers\jdbc\books.pdf and apama_install_dir\doc\db_drivers\odbc\books.pdf.
Apama provides two Application Programming Interfaces (APIs) for using the ADBC Connector: the ADBCHelper API and the ADBC Event API.
The ADBCHelper API contains the basic features you need for most common use cases, such as opening and closing databases and executing SQL commands and queries. For more information on the ADBCHelper API, see
The ADBCHelper Application Programming Interface.
The ADBC Event API contains features for more complex use cases. For example, in addition to opening and closing databases, it contains actions for discovering what data sources and databases are available. For more information on the ADBC Event API, see
The ADBC Event Application Programming Interface.
The ADBC Adapter editor in Apama Studio includes an Event Mapping tab that lets you quickly specify the mapping rules for storing events in existing database tables. Apama Studio generates a service monitor that listens for the events of interest and stores them in the database. This monitor provides a quick and straight forward way of writing event data to a database for general analytical purposes; however, it is not meant to be a fail-safe management system.
The ADBC adapter uses separate thread pools for executing queries and commands and will execute each command and query in its own thread. The thread pools are created with a minimum of four threads but for machines with more than four CPU cores the number of threads will match the number of cores. The adapter log will show the number of threads in the thread pools, for example:
Query and Command threadpools using 4 threads
The maximum number of concurrent queries running will match the number of threads in the thread pool. As an example, on a machine with less than four cores, this would be four concurrent queries and four concurrent commands.
Additional queries and commands submitted will be queued for execution until a thread becomes free. If more than four long running queries are submitted, additional queries will be queued. If a mix of short and known long running queries are being used, the application may want to control the submission of long running queries to ensure the shorter duration queries do not have to wait. If the execution of the short duration queries are required to be run without delay, a second adapter can also be started and used to service just the shorter duration queries.