How do I loop through all the causes of a SQLException?
Created May 8, 2012
John Zukowski You can call the getCause() method of the exception repeatedly
try { ... } catch (SQLException sqle) { for(Throwable t : sqle) { System.out.println("Throwable: " + t); Throwable cause = t.getCause(); while (cause != null) { System.out.println(Cause: + cause); cause = cause.getCause(); } } }