Open topic with navigation

TIBCO BusinessEvents® Enterprise Edition 6.3.1

# The setCurrentConnection and unsetConnection Functions

Use `setCurrentConnection()` once before performing any database operation. Use `unsetConnection()` once after all database operations are performed.

In your rule or rule function, you must first connect to the database.

    Database.setCurrentConnection ("/MyDbConnection");
    Operations
    Database.unsetConnection();

You must call `unsetConnection()` even in case of a failure within the rule function. If you do not unset the connection, the connection is not returned to the database connection pool.

Use of `setCurrentConnection()` may result in an exception if the underlying database is disconnected. You can first use `getConnectionStatus()` to determine if the database (specified by a JDBC connection resource URI) is connected.

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.