Recommended solutions based on your search
Check whether privilege has the "not null" restriction. If so it always has to have a value and can never be null.
A different reason could be a wrong implementation of a foreign key. Check whether you always correctly insert/update in both tables.
Nothing is wrong with the database. When it gives you those errors, it's telling you that you are trying to input "nothing" (null) into a column that doesn't allow it. Fix it by removing the not null constraint or by passing a value to that field.
Solutions on the web
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`confluence`.<result 2 when explaining filename '#sql-c6e3_183421'>, CONSTRAINT `fk_user_dir_id` FOREIGN KEY (`directory_id`) REFERENCES `cwd_directory` (`id`))
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)