Connection.commitTransaction()

NES3+Syntax

							connection.commitTransaction()

Description

The commitTransaction() method of the Connection object commits a new SQL transaction. This commits all the actions against the database since the last commit. If the commit is successful, 0 is returned. If a non-zero number is returned, an error is encountered. In this case, various methods of the Connection object can be used to retrieve the code and message of the error.

Example

Listing 8.13 creates a pool of connections to an Oracle database and pulls one of the connections from the pool. After the connection has been verified, the beginTransaction() method is called and a SQL query is performed. The results are formatted in a table with the SQLTable() ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.