Added database connection to class initialization.
Recoded class initialization so that the database connection is included.