Show how to close a connection
This commit is contained in:
parent
a4fd0dc574
commit
1b43274d12
|
@ -42,8 +42,9 @@ and call its :meth:`~Cursor.execute` method to perform SQL commands::
|
|||
# Save (commit) the changes
|
||||
conn.commit()
|
||||
|
||||
# We can also close the cursor if we are done with it
|
||||
c.close()
|
||||
# We can also close the connection if we are done with it.
|
||||
# Just be sure any changes have been committed or they will be lost.
|
||||
conn.close()
|
||||
|
||||
The data you've saved is persistent and is available in subsequent sessions::
|
||||
|
||||
|
|
Loading…
Reference in New Issue