Recap - CRUD Operations

Let us recap the process of performing CRUD operations

  • Establish connection to the database - Create Connection Object

  • Create Cursor Object using Connection Object - connection.cursor.

  • Build Statement to perform one or more INSERT, UPDATE or DELETE.

  • When we perform DML operations as part of transactions such as INSERT, UPDATE or DELETE make sure transactions without exceptions are committed and transactions with exceptions are rolled back.

  • Make sure cursors as well as connections are closed

  • If the database operation involves select only, then we don’t need to commit or rollback. SELECT only reads the data, it will not make any changes to the data in the database.