Here you can find the source of parseRemoteException(Throwable t)
private static SQLException parseRemoteException(Throwable t)
//package com.java2s; import java.sql.SQLException; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { private static final Pattern PATTERN = Pattern.compile("ERROR (\\d+) \\((\\w+)\\): (.*)"); private static SQLException parseRemoteException(Throwable t) { String message = t.getLocalizedMessage(); if (message != null) { // If the message matches the standard pattern, recover the SQLException and throw it. Matcher matcher = PATTERN.matcher(t.getLocalizedMessage()); if (matcher.find()) { int errorCode = Integer.parseInt(matcher.group(1)); String sqlState = matcher.group(2); return new SQLException(matcher.group(), sqlState, errorCode, t); }/*from ww w . j a va2 s . c om*/ } return null; } }