def insert(self, sql, packetbytes=None):
    params = None
    if (packetbytes != None):
        sql = (sql + ', packetbytes=%s')
        params = (MySQLdb.Binary(packetbytes),)
    self.conn.execute(sql, params)
    if (self.conn.rowcount != 1):
        raise Exception('DBLogger: Insert did not succeed.')
    self.db.commit()
    return self.conn.lastrowid
def insert(self, sql, packetbytes=None):
    params = None
    if (packetbytes != None):
        sql = (sql + ', packetbytes=%s')
        params = (MySQLdb.Binary(packetbytes),)
    self.conn.execute(sql, params)
    if (self.conn.rowcount != 1):
        raise Exception('DBLogger: Insert did not succeed.')
    self.db.commit()
    return self.conn.lastrowid