Open topic with navigation

TIBCO BusinessEvents® Enterprise Edition 6.3.1

# Oracle Catalog Functions

Oracle catalog functions are extended functions that can be used to perform database operations in rules and rule functions.

Add the following property in the `studio.tra` file to use the Oracle catalog functions.

    TIBCO.BE.function.catalog.Oracle=true

Default value of the property is `false`. In the Built-in Functions Oracle catalog, this property enables/disables the following functions:

- `closeResultSet`
- `commit`
- `executeQuery`
- `getColumnValueByIndex`
- `getColumnValueByName`
- `getConnection`
- `getConnectionWithTimeout`
- `next`
- `registerConnection`
- `releaseConnection`
- `rollback`

The Oracle catalog function `executeQuery` is used only to select queries and not to perform the insert, update, and delete operations. Use the RDBMS catalog function to perform the insert, update, and delete operations, see Insert Operations and Update and Delete Operations.

The `registerConnection` function creates a pool of database connections and registers with the specified key. The syntax of the `registerConnection` function is:

    void registerConnection(String key,String uri,int poolSize)

In the `registerConnection` function, the poolsize parameter defines the required number of database connections in the pool. The settings of the parameter depend on your project requirements, such as, using more connections improves the runtime performance when the registered connection is used in multiple rules.

## Example

The following code shows the example usage of the Oracle catalog functions:

    String connection ="/SharedResources/JDBCConnection.sharedjdbc";
    Oracle.registerConnection("sstConnection",connection, 10);
    Object cnx = Oracle.getConnection("sstConnection");
    String sRequest =  "select to_char(count(*)) as NB from d_account";
    String  nextResponse ;
    Object[] args = {};
    Object res = Oracle.executeQuery(cnx, sRequest, args);
    if (res!= null){
       while(Oracle.next(res)) {
          nextResponse =  String.trim(Oracle.getColumnValueByName(res,"NB"));
        }
    }
    Oracle.closeResultSet(res);
    Oracle.releaseConnection(cnx);

Did you find this helpful?

YesNo
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO BusinessEvents® Enterprise Edition

Copyright © 2004-2024. Cloud Software Group, Inc. All Rights Reserved.