应用程序抛出 java.sql.SQLIntegrityConstraintViolationException 并且它的约束名称如下
Exception in thread "main" javax.ejb.EJBException: EJB Exception: ; nested exception is:
javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.2.v20101206-r8635): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (**CONSTRAINT.UNIQUE_WT**) violated
问题:是否有 API/直接方法可以 从异常对象 (java.sql.SQLIntegrityConstraintViolationException)中获取约束名称CONSTRAINT.UNIQUE_WT ?
想法是,如果我可以获得约束名称,我可以提供适当的错误消息。