[Tutor] python classes and mysql
rickp@telocity.com
rickp@telocity.com
Tue, 13 Aug 2002 09:40:04 -0400
If I create multiple classes in python to deal with different aspects of
a program and each of those classes needs to access mysql what is the
best way of handling connections/cursors?
1) Each class opens a connection and creates a cursor.
2) The toplevel opens a connection which is passed to the class which
then creates a cursor.
3) The toplevel opens a connection and creates a cursor which is passed
to the class.
--
"Cream rises to the top. So does fat."
-- Kelvin Throop III
Rick Pasotto rickp@telocity.com http://www.niof.net