def __init__(self, dbname, host, port, user, password):
        self.dbname = dbname
        self.host = host
        self.port = port
        self.user = user
        self.password = password
        try:
            self.conn = psycopg2.connect(
                "dbname=%s host=%s port=%s \
                                          user=%s password=%s" %
                (dbname, host, port, user, password))
            print("Opened database successfully")
        except BaseException:
            print("I'm unable to connect to the database. Exiting function.")