Java SQLException isReadOnlyException(SQLException e)

Here you can find the source of isReadOnlyException(SQLException e)

Description

is Read Only Exception

License

Apache License

Declaration

public static boolean isReadOnlyException(SQLException e) 

Method Source Code

//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*/
}

Related

  1. isDatabaseAlreadyExistsException(Exception e)
  2. isDataConversionException(SQLException se)
  3. isDuplicateKeyException(Exception ex)
  4. isInvalidParameterException(SQLException se)
  5. isPSQLUniqueViolation(SQLException ex)
  6. isRecoverableException(SQLException e)
  7. isTransient(SQLException e)
  8. isXJ015Error(Throwable exception)
  9. log(Logger logger, SQLException e)