python database access commit(commits all pending transactions to the database if the database supports transactionsthis must be called for any changes to take effect if the underlying database does not support transactionsthis method does nothing rollback(rolls back the database to the start of any pending transactions this method is sometimes used in databases that do not support transactions in order to undo any changes made to the database for exampleif an exception occurred in code that was in the middle of updating databaseyou might use this to undo changes made before the exception cursor(creates new cursor object that uses the connection cursor is an object that you will use to execute sql queries and obtain results this is described in the next section cursors in order to perform any operations on the databaseyou first create connection and then you call cursor(method to create cursor object an instance cur of cursor has number of standard methods and attributes that are used to execute queriescur callproc(procname [parameters]calls stored procedure with name procname parameterswhich is sequence of values that are used as the arguments to the procedure the result of this function is sequence with the same number of items as parameters this sequence is copy of parameters where the values of any output arguments have been replaced with their modified values after execution if procedure also produces an output setit can be read using the fetch*(methods described next cur close(closes the cursorpreventing any further operations on it cur execute(query [parameters]executes query or command query on the database query is string containing the command (usually sql)and parameters is either sequence or mapping that is used to supply values to variables in the query string (this is described in the next sectioncur executemany(query [parametersequence]repeatedly executes query or command query is query stringand parametersquence is sequence of parameters each item in this sequence is sequence or mapping object that you would have used with the execute(method shown earlier cur fetchone(returns the next row of the result set produced by execute(or executemany(the result is typically list or tuple containing values for the different columns of the result none is returned if there are no more rows available an exception is raised if there is no pending result or if the previously executed operation didn' create result set lib fl ff