/** * PUBLIC: * This is the database error number. * Since it is possible to have no internal exception the errorCode will be zero in this case. */ public int getDatabaseErrorCode() { if (getInternalException() == null) { return super.getErrorCode(); } return ((SQLException)getInternalException()).getErrorCode(); }
/** * PUBLIC: * This is the database error number. * Since it is possible to have no internal exception the errorCode will be zero in this case. */ public int getDatabaseErrorCode() { if (getInternalException() == null) { return super.getErrorCode(); } return ((SQLException)getInternalException()).getErrorCode(); }
/** * PUBLIC: * This is the database error number. * Since it is possible to have no internal exception the errorCode will be zero in this case. */ public int getDatabaseErrorCode() { if (getInternalException() == null) { return super.getErrorCode(); } return ((SQLException)getInternalException()).getErrorCode(); }
/** * Exception occurred. * * @param exception the exception * @return the JPARS exception */ public static JPARSException exceptionOccurred(Exception exception) { if (exception instanceof JPARSException) { return (JPARSException)exception; } int errorCode = JPARSErrorCodes.AN_EXCEPTION_OCCURRED; String msg = ExceptionMessageGenerator.buildMessage(JPARSException.class, errorCode, new Object[] { exception.getClass().getSimpleName() }).trim(); if (exception instanceof EclipseLinkException) { errorCode = ((EclipseLinkException) exception).getErrorCode(); msg = ((EclipseLinkException) exception).getClass().getName().trim(); } else if (exception.getCause() instanceof EclipseLinkException) { errorCode = ((EclipseLinkException) (exception.getCause())).getErrorCode(); msg = ((EclipseLinkException) (exception.getCause())).getClass().getName().trim(); } JPARSException jparsException = new JPARSException(msg, exception); jparsException.setErrorCode(errorCode); jparsException.setInternalException(exception); return jparsException; } }
/** * Exception occurred. * * @param exception the exception * @return the JPARS exception */ public static JPARSException exceptionOccurred(Exception exception) { if (exception instanceof JPARSException) { return (JPARSException)exception; } int errorCode = JPARSErrorCodes.AN_EXCEPTION_OCCURRED; String msg = ExceptionMessageGenerator.buildMessage(JPARSException.class, errorCode, new Object[] { exception.getClass().getSimpleName() }).trim(); if (exception instanceof EclipseLinkException) { errorCode = ((EclipseLinkException) exception).getErrorCode(); msg = ((EclipseLinkException) exception).getClass().getName().trim(); } else if (exception.getCause() instanceof EclipseLinkException) { errorCode = ((EclipseLinkException) (exception.getCause())).getErrorCode(); msg = ((EclipseLinkException) (exception.getCause())).getClass().getName().trim(); } JPARSException jparsException = new JPARSException(msg, exception); jparsException.setErrorCode(errorCode); jparsException.setInternalException(exception); return jparsException; } }
/** * INTERNAL: */ public String toString() { return getIndentationString() + ExceptionMessageGenerator.getHeader("ExceptionHeader") + getErrorCode() + "] (" + org.eclipse.persistence.sessions.DatabaseLogin.getVersion() + "): " + getClass().getName() + getMessage(); } }
/** * INTERNAL: */ public String toString() { return getIndentationString() + ExceptionMessageGenerator.getHeader("ExceptionHeader") + getErrorCode() + "] (" + org.eclipse.persistence.sessions.DatabaseLogin.getVersion() + "): " + getClass().getName() + getMessage(); }
/** * INTERNAL: */ public String toString() { return getIndentationString() + ExceptionMessageGenerator.getHeader("ExceptionHeader") + getErrorCode() + "] (" + org.eclipse.persistence.sessions.DatabaseLogin.getVersion() + "): " + getClass().getName() + getMessage(); }