you can terminate the thread, but QSqlQuery .exec continue runing.