update sql and class