I have a class that contains three methods:
- insert
- update
- delete
Each of these methods works with a database. Which is a better method?
- Connect to the database in the constructor and close the connection in the destructor, or
- Open and close a connection in each method separately?