Apama 10.3 | Apama Documentation | Connecting Apama Applications to External Components | Standard IAF Plug-ins | The Database Connector IAF Adapter (ADBC) | The ADBC Event application programming interface | Closing a database
Closing a database
In order to close a database your application should implement the following steps:
1. Call the closeDatabase() action of the Connection event (for the open database) with the name of the callback action.
2. Create a handler action for the closeDatabase callback action.
The definitions for the two forms of the closeDatabase() action are:
action closeDatabase(
  action <Connection, string> callback)
action closeDatabaseFull(
  boolean force,
  dictionary<string,string> extraParams,
  action<Connection,string> callback)
The relevant code in the samples\adbc\api-example\ADBC_Example.mon file is similar to this:
com.apama.database.Connection conn :=
new com.apama.database.Connection;
// ...

    conn.openDatabase(serviceId, results[0].dbUrl, "",

// ...


action handleCloseDatabase(com.apama.database.Connection conn,
string error)
if error.length() != 0 {
log "Error closing database " + getDbName() + ": " +
     error at ERROR;
else {
log "Database " + getDbName() + " closed." at INFO;    

Copyright © 2013-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.