SAP HANA XS Database API($.db) provides tools that enable simple and convenient access to database.
- $.db.getConnection().
It returns $.internal.api.Connection object which has below method. - close()
closes the connection. - commit()
commits the connection. - isClosed()
Checks if connection is closed or not. - prepareCall()
Prepares a stored procedure for execution.
Returns $.internal.api.CallableStatement object. - prepareStatement(statement)
Prepares a statement fro execution.
Returns $.internal.api.PreparedStatement object and following methods. - executeQuery()
Executes an SQL statement and returns $.internal.api.ResultSet object and has below methods. - getString(column Index).
Return String for a specified columns. - next()
Iterates to next row of result set. - executeUpdate()
execute the update statement and returns the number of changed rows. - rollback()
Rolls back the changes. - setAutoCommit()
Changes the auto commit flag of the connection. - Example: