// Path: src/main/java/com/mysql/jdbc/exceptions/MySQLDataException.java
// public class MySQLDataException extends MySQLNonTransientException {
// 
// 	public MySQLDataException() {
// 		super();
// 	}
// 
// 	public MySQLDataException(String reason, String SQLState, int vendorCode) {
// 		super(reason, SQLState, vendorCode);
// 	}
// 
// 	public MySQLDataException(String reason, String SQLState) {
// 		super(reason, SQLState);
// 	}
// 
// 	public MySQLDataException(String reason) {
// 		super(reason);
// 	}
// }
// 
// Path: src/main/java/com/mysql/jdbc/exceptions/MySQLIntegrityConstraintViolationException.java
// public class MySQLIntegrityConstraintViolationException extends
// 		MySQLNonTransientException {
// 
// 	public MySQLIntegrityConstraintViolationException() {
// 		super();
// 	}
// 
// 	public MySQLIntegrityConstraintViolationException(String reason, String SQLState, int vendorCode) {
// 		super(reason, SQLState, vendorCode);
// 	}
// 
// 	public MySQLIntegrityConstraintViolationException(String reason, String SQLState) {
// 		super(reason, SQLState);
// 	}
// 
// 	public MySQLIntegrityConstraintViolationException(String reason) {
// 		super(reason);
// 	}
// }
// 
// Path: src/main/java/com/mysql/jdbc/exceptions/MySQLNonTransientConnectionException.java
// public class MySQLNonTransientConnectionException extends
// 		MySQLNonTransientException {
// 
// 	public MySQLNonTransientConnectionException() {
// 		super();
// 	}
// 
// 	public MySQLNonTransientConnectionException(String reason, String SQLState, int vendorCode) {
// 		super(reason, SQLState, vendorCode);
// 	}
// 
// 	public MySQLNonTransientConnectionException(String reason, String SQLState) {
// 		super(reason, SQLState);
// 	}
// 
// 	public MySQLNonTransientConnectionException(String reason) {
// 		super(reason);
// 	}
// }
// 
// Path: src/main/java/com/mysql/jdbc/exceptions/MySQLSyntaxErrorException.java
// public class MySQLSyntaxErrorException extends MySQLNonTransientException {
// 
// 	public MySQLSyntaxErrorException() {
// 		super();
// 	}
// 
// 	public MySQLSyntaxErrorException(String reason, String SQLState, int vendorCode) {
// 		super(reason, SQLState, vendorCode);
// 	}
// 
// 	public MySQLSyntaxErrorException(String reason, String SQLState) {
// 		super(reason, SQLState);
// 	}
// 
// 	public MySQLSyntaxErrorException(String reason) {
// 		super(reason);
// 	}
// }
// 
// Path: src/main/java/com/mysql/jdbc/exceptions/MySQLTransactionRollbackException.java
// public class MySQLTransactionRollbackException extends MySQLTransientException implements DeadlockTimeoutRollbackMarker {
// 
// 	public MySQLTransactionRollbackException(String reason, String SQLState,
// 			int vendorCode) {
// 		super(reason, SQLState, vendorCode);
// 	}
// 
// 	public MySQLTransactionRollbackException(String reason, String SQLState) {
// 		super(reason, SQLState);
// 	}
// 
// 	public MySQLTransactionRollbackException(String reason) {
// 		super(reason);
// 	}
// 
// 	public MySQLTransactionRollbackException() {
// 		super();
// 	}
// }
// 
// Path: src/main/java/com/mysql/jdbc/exceptions/MySQLTransientConnectionException.java
// public class MySQLTransientConnectionException extends MySQLTransientException {
// 
// 	public MySQLTransientConnectionException(String reason, String SQLState,
// 			int vendorCode) {
// 		super(reason, SQLState, vendorCode);
// 	}
// 
// 	public MySQLTransientConnectionException(String reason, String SQLState) {
// 		super(reason, SQLState);
// 	}
// 
// 	public MySQLTransientConnectionException(String reason) {
// 		super(reason);
// 	}
// 
// 	public MySQLTransientConnectionException() {
// 		super();
// 	}
// }


import java.sql.SQLWarning;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Map;
import java.util.TreeMap;
import com.mysql.jdbc.exceptions.MySQLDataException;
import com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException;
import com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException;
import com.mysql.jdbc.exceptions.MySQLSyntaxErrorException;
import com.mysql.jdbc.exceptions.MySQLTransactionRollbackException;
import com.mysql.jdbc.exceptions.MySQLTransientConnectionException;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.net.BindException;
import java.sql.DataTruncation;
import java.sql.SQLException;
	public static SQLException createSQLException(String message,
			String sqlState, int vendorErrorCode, ExceptionInterceptor interceptor) {
		return createSQLException(message, sqlState, vendorErrorCode, false, interceptor);
	}
	
	public static SQLException createSQLException(String message,
			String sqlState, int vendorErrorCode, boolean isTransient, ExceptionInterceptor interceptor) {
		return createSQLException(message, sqlState, vendorErrorCode, false, interceptor, null);
	}
	public static SQLException createSQLException(String message,
			String sqlState, int vendorErrorCode, boolean isTransient, ExceptionInterceptor interceptor, Connection conn) {
		try {
			SQLException sqlEx = null;
			
			if (sqlState != null) {
				if (sqlState.startsWith("08")) {
					if (isTransient) {
						if (!Util.isJdbc4()) {
							sqlEx = new MySQLTransientConnectionException(
									message, sqlState, vendorErrorCode);
						} else {
							sqlEx = (SQLException) Util
								.getInstance(
										"com.mysql.jdbc.exceptions.jdbc4.MySQLTransientConnectionException",
										new Class[] { String.class,
												String.class, Integer.TYPE },
										new Object[] { message, sqlState,
												Integer.valueOf(vendorErrorCode) }, interceptor);
						}
					} else if (!Util.isJdbc4()) {
// Path: src/main/java/com/mysql/jdbc/exceptions/MySQLDataException.java
// public class MySQLDataException extends MySQLNonTransientException {
// 
// 	public MySQLDataException() {
// 		super();
// 	}
// 
// 	public MySQLDataException(String reason, String SQLState, int vendorCode) {
// 		super(reason, SQLState, vendorCode);
// 	}
// 
// 	public MySQLDataException(String reason, String SQLState) {
// 		super(reason, SQLState);
// 	}
// 
// 	public MySQLDataException(String reason) {
// 		super(reason);
// 	}
// }
// 
// Path: src/main/java/com/mysql/jdbc/exceptions/MySQLIntegrityConstraintViolationException.java
// public class MySQLIntegrityConstraintViolationException extends
// 		MySQLNonTransientException {
// 
// 	public MySQLIntegrityConstraintViolationException() {
// 		super();
// 	}
// 
// 	public MySQLIntegrityConstraintViolationException(String reason, String SQLState, int vendorCode) {
// 		super(reason, SQLState, vendorCode);
// 	}
// 
// 	public MySQLIntegrityConstraintViolationException(String reason, String SQLState) {
// 		super(reason, SQLState);
// 	}
// 
// 	public MySQLIntegrityConstraintViolationException(String reason) {
// 		super(reason);
// 	}
// }
// 
// Path: src/main/java/com/mysql/jdbc/exceptions/MySQLNonTransientConnectionException.java
// public class MySQLNonTransientConnectionException extends
// 		MySQLNonTransientException {
// 
// 	public MySQLNonTransientConnectionException() {
// 		super();
// 	}
// 
// 	public MySQLNonTransientConnectionException(String reason, String SQLState, int vendorCode) {
// 		super(reason, SQLState, vendorCode);
// 	}
// 
// 	public MySQLNonTransientConnectionException(String reason, String SQLState) {
// 		super(reason, SQLState);
// 	}
// 
// 	public MySQLNonTransientConnectionException(String reason) {
// 		super(reason);
// 	}
// }
// 
// Path: src/main/java/com/mysql/jdbc/exceptions/MySQLSyntaxErrorException.java
// public class MySQLSyntaxErrorException extends MySQLNonTransientException {
// 
// 	public MySQLSyntaxErrorException() {
// 		super();
// 	}
// 
// 	public MySQLSyntaxErrorException(String reason, String SQLState, int vendorCode) {
// 		super(reason, SQLState, vendorCode);
// 	}
// 
// 	public MySQLSyntaxErrorException(String reason, String SQLState) {
// 		super(reason, SQLState);
// 	}
// 
// 	public MySQLSyntaxErrorException(String reason) {
// 		super(reason);
// 	}
// }
// 
// Path: src/main/java/com/mysql/jdbc/exceptions/MySQLTransactionRollbackException.java
// public class MySQLTransactionRollbackException extends MySQLTransientException implements DeadlockTimeoutRollbackMarker {
// 
// 	public MySQLTransactionRollbackException(String reason, String SQLState,
// 			int vendorCode) {
// 		super(reason, SQLState, vendorCode);
// 	}
// 
// 	public MySQLTransactionRollbackException(String reason, String SQLState) {
// 		super(reason, SQLState);
// 	}
// 
// 	public MySQLTransactionRollbackException(String reason) {
// 		super(reason);
// 	}
// 
// 	public MySQLTransactionRollbackException() {
// 		super();
// 	}
// }
// 
// Path: src/main/java/com/mysql/jdbc/exceptions/MySQLTransientConnectionException.java
// public class MySQLTransientConnectionException extends MySQLTransientException {
// 
// 	public MySQLTransientConnectionException(String reason, String SQLState,
// 			int vendorCode) {
// 		super(reason, SQLState, vendorCode);
// 	}
// 
// 	public MySQLTransientConnectionException(String reason, String SQLState) {
// 		super(reason, SQLState);
// 	}
// 
// 	public MySQLTransientConnectionException(String reason) {
// 		super(reason);
// 	}
// 
// 	public MySQLTransientConnectionException() {
// 		super();
// 	}
// }


// Path: src/main/java/com/mysql/jdbc/SQLError.java
import java.sql.SQLWarning;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Map;
import java.util.TreeMap;
import com.mysql.jdbc.exceptions.MySQLDataException;
import com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException;
import com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException;
import com.mysql.jdbc.exceptions.MySQLSyntaxErrorException;
import com.mysql.jdbc.exceptions.MySQLTransactionRollbackException;
import com.mysql.jdbc.exceptions.MySQLTransientConnectionException;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.net.BindException;
import java.sql.DataTruncation;
import java.sql.SQLException;

	public static SQLException createSQLException(String message,
			String sqlState, int vendorErrorCode, ExceptionInterceptor interceptor) {
		return createSQLException(message, sqlState, vendorErrorCode, false, interceptor);
	}
	
	public static SQLException createSQLException(String message,
			String sqlState, int vendorErrorCode, boolean isTransient, ExceptionInterceptor interceptor) {
		return createSQLException(message, sqlState, vendorErrorCode, false, interceptor, null);
	}
	public static SQLException createSQLException(String message,
			String sqlState, int vendorErrorCode, boolean isTransient, ExceptionInterceptor interceptor, Connection conn) {
		try {
			SQLException sqlEx = null;
			
			if (sqlState != null) {
				if (sqlState.startsWith("08")) {
					if (isTransient) {
						if (!Util.isJdbc4()) {
							sqlEx = new MySQLTransientConnectionException(
									message, sqlState, vendorErrorCode);
						} else {
							sqlEx = (SQLException) Util
								.getInstance(
										"com.mysql.jdbc.exceptions.jdbc4.MySQLTransientConnectionException",
										new Class[] { String.class,
												String.class, Integer.TYPE },
										new Object[] { message, sqlState,
												Integer.valueOf(vendorErrorCode) }, interceptor);
						}
					} else if (!Util.isJdbc4()) {
						sqlEx = new MySQLNonTransientConnectionException(