Disconnecting Database in Python

PythonServer Side ProgrammingProgramming

To disconnect Database connection, use close() method.

db.close()

If the connection to a database is closed by the user with the close() method, any outstanding transactions are rolled back by the DB. However, instead of depending on any of DB lower level implementation details, your application would be better off calling commit or rollback explicitly.

raja
Published on 31-Jan-2020 10:02:53
Advertisements