Hi guys, i have this text:
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`sita4`.`control`, CONSTRAINT `reffinalit` FOREIGN KEY (`finalit`) REFERENCES `finalit` (`cod`) ON DELETE NO ACTION ON UPDATE NO ACTION)
and i want take the field that have send foreign key in this case "finalit", i have make this code:
why replaceall not work on bracket?[B]int beginIndex = msgerror[0].indexOf("FOREIGN KEY"); int endIndex = msgerror[0].indexOf("REFERENCES"); String field = msgerror[0].substring(beginIndex,endIndex); field = field.replaceAll("FOREIGN KEY", ""); field = field.replaceAll(" *\\(`\\d+`\\)*", ""); \\this not work and field is = ('finalit')[/B]
Thanks.