Apama 10.15.1 | Building and Using Apama Dashboards | Building Dashboard Clients | Using SQL Data | Setting up SQL database connections | Direct JDBC connection
 
Direct JDBC connection
In order for Apama to communicate with your database using a straight JDBC connection, you must have a JDBC driver for your database.
Apama includes JDBC database drivers that eliminate the need to install database-vendor-supplied drivers. When you add a database to a dashboard you can specify the use of one of these Apama drivers. To add a database to a dashboard, see SQL tab, which provides information about the Add Database dialog. To use the Apama JDBC database driver for an added database, enter values for JDBC Options in the Add Database dialog. Also, be sure to add the jar file that contains the appropriate driver class to your Dashboard Properties (select Properties from the Project menu in Software AG Designer).
To use the Apama JDBC driver, specify the following according to the type of SQL database you want to add. In the URL, replace HOSTNAME, PORT and DATABASENAME or DATABASESID with the actual values for the particular database you want to connect to.
*MSSQL (eysqlserver.jar is in the apama_install_dir\lib folder)
URL: jdbc:sag:sqlserver://HOSTNAME::PORT;databaseName=DATABASENAME
Class name: com.apama.jdbc.sqlserver.SQLServerDriver
*Oracle (eyoracle.jar in the apama_install_dir\lib folder)
URL: jdbc:sag:oracle://HOSTNAME::PORT;SID=DATABASESID
Class name: com.apama.jdbc.oracle.OracleDriver
JDBC drivers are available from most database vendors.
To make a non-Apama database driver available to Apama:
1. Locate the driver on your machine and add the jar that contains the driver class to your Dashboard Properties (select Properties from the Project menu in Software AG Designer).
2. Add the path to the JDBC driver jar file to the APAMA_DASHBOARD_CLASSPATH environment variable or to run the dashboard processes with --dashboardExtraJars option. This is required for the data server, display server or dashboard builder to be able to find and load the JDBC driver class. You can add paths to multiple driver classes.
3. In the Add Database dialog, provide the database URL and the class name for your JDBC driver. The database URL typically contains the protocol and sub-protocol strings for your database as well as the path to the database and a list of properties. If you do not know the syntax for your database URL, consult the documentation for your JDBC driver.