1 24 25 package com.mckoi.database; 26 27 32 33 public class DatabaseConstraintViolationException extends RuntimeException { 34 35 37 40 public static final int PRIMARY_KEY_VIOLATION = 20; 41 42 45 public static final int UNIQUE_VIOLATION = 21; 46 47 50 public static final int CHECK_VIOLATION = 22; 51 52 55 public static final int FOREIGN_KEY_VIOLATION = 23; 56 57 61 public static final int NULLABLE_VIOLATION = 24; 62 63 67 public static final int JAVA_TYPE_VIOLATION = 25; 68 69 72 public static final int DROP_TABLE_VIOLATION = 26; 73 74 77 public static final int DROP_COLUMN_VIOLATION = 27; 78 79 80 83 private int error_code; 84 85 88 public DatabaseConstraintViolationException(int err_code, String msg) { 89 super(msg); 90 this.error_code = err_code; 91 } 92 93 96 public int getErrorCode() { 97 return error_code; 98 } 99 100 } 101 | Popular Tags |