public Object getFieldValue(_Fields field) { switch (field) { case REASON: return getReason(); case SQL_STATE: return getSqlState(); case SEVERITY: return Integer.valueOf(getSeverity()); } throw new IllegalStateException(); }
public static SQLException newSQLException(GFXDExceptionData payload, Throwable cause, String serverInfo) { String message = payload.getReason(); if (serverInfo != null) { message = "(" + serverInfo + ") " + message; } return factory.getSQLException(message, payload.getSqlState(), payload.getSeverity(), null, cause); }
public static SQLWarning newSQLWarning(GFXDExceptionData payload, Throwable cause) { return new SQLWarning(payload.getReason(), payload.getSqlState(), payload.getSeverity(), cause); }
public static SQLException newSQLException(GFXDException gfxde) { GFXDExceptionData payload = gfxde.getExceptionData(); SQLException sqle = newSQLException(payload, gfxde.getCause(), gfxde.getServerInfo()); // since GFXDException is always a wrapper, no need to record the stack sqle.setStackTrace(gfxde.getStackTrace()); // build next exceptions List<GFXDExceptionData> nextList = gfxde.getNextExceptions(); SQLException current = sqle, next; if (nextList != null) { for (GFXDExceptionData nextData : nextList) { // check for server stack indicator if (SQLState.GFXD_SERVER_STACK_INDICATOR.equals( nextData.getSqlState())) { Throwable cause = sqle; while (cause.getCause() != null) { cause = cause.getCause(); } cause.initCause(new ServerException(nextData.getReason())); } else { next = newSQLException(nextData, null, null); current.setNextException(next); current = next; } } } return sqle; }
gfxde.getExceptionData().getSqlState())) { SanityManager.DEBUG_PRINT("warning:" + SanityManager.TRACE_CLIENT_STMT,
gfxde.getExceptionData().getSqlState())) { SanityManager.DEBUG_PRINT("warning:" + SanityManager.TRACE_CLIENT_STMT,
GFXDException gfxde = (GFXDException)t; GFXDExceptionData gfxdeData = gfxde.getExceptionData(); String sqlState = gfxdeData.getSqlState(); NetConnection.FailoverStatus status; if ((status = NetConnection.getFailoverStatus(sqlState,
NetConnection.FailoverStatus status; if ((status = NetConnection.getFailoverStatus(gfxde .getExceptionData().getSqlState(), gfxde.getExceptionData() .getSeverity(), gfxde)).isNone()) { throw gfxde;