Here you can find the source of isReadOnlyException(SQLException e)
public static boolean isReadOnlyException(SQLException e)
//package com.java2s; //License from project: Apache License import java.sql.SQLException; public class Main { private final static int READ_ONLY_ERROR_CODE = 1290; private final static String READ_ONLY_ERROR_MESSAGE = "read-only"; public static boolean isReadOnlyException(SQLException e) { return e.getErrorCode() == READ_ONLY_ERROR_CODE && e.getMessage().contains(READ_ONLY_ERROR_MESSAGE); }/*from w w w . j ava 2 s .com*/ }