Thursday 5 January 2023

OADBTransactionImpl in Oracle Application Framework (OAF)

OADBTransactionImpl is a class in Oracle Application Framework (OAF), which is a framework for building Oracle E-Business Suite applications.
OADBTransactionImpl represents a database transaction in OAF. It provides methods for accessing and modifying data in the database, as well as for executing database queries and operations.
Here is an example of how you might use the OADBTransactionImpl class in an OAF application:

Example:

import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.server.OADBTransactionImpl;

public class MyClass {
public void updateRecord(OAApplicationModule am, String recordId) throws OAException {
// Get a reference to the current database transaction
OADBTransactionImpl transaction = (OADBTransactionImpl)am.getOADBTransaction();
// Execute a SQL update statement to update a record in the database
String sql = "UPDATE my_table SET field1 = 'new value' WHERE id = :1";
transaction.executeSql(sql, new Object[] {recordId});
}
}

Here is a list of some of the methods of the Oracle Application Framework (OAF) OADBTransactionImpl class:
  • executeSql(String sql, Object[] bindArgs): Executes a SQL statement and returns the number of rows affected.
  • executeSqlStmt(String sql, Object[] bindArgs): Executes a SQL statement and returns a PreparedStatement object.
  • commit(): Commits the current database transaction.
  • rollback(): Rolls back the current database transaction.
  • getSequenceNumber(String sequenceName): Retrieves the next value from a database sequence.
  • getDBDate(Calendar calendar): Retrieves the current date and time from the database.
  • getDBTimestamp(Calendar calendar): Retrieves the current date and time, including fractions of a second, from the database.

No comments:

Post a Comment

OADBTransactionImpl in Oracle Application Framework (OAF)

OADBTransactionImpl is a class in Oracle Application Framework (OAF), which is a framework for building Oracle E-Business Suite applications...