⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 errorcode.java

📁 非常棒的java数据库
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
    public static final int ERROR_SETTING_DATABASE_EVENT_LISTENER_2 = 90099;

    /**
     * The error with code <code>90100</code> is thrown when
     * there is no more space available on the device where the database
     * files are stored.
     */
    public static final int NO_DISK_SPACE_AVAILABLE = 90100;

    /**
     * The error with code <code>90101</code> is thrown when
     * the XA API detected unsupported transaction names. This can happen
     * when mixing application generated transaction names and transaction names
     * generated by this databases XAConnection API.
     */
    public static final int WRONG_XID_FORMAT_1 = 90101;

    /**
     * The error with code <code>90102</code> is thrown when
     * trying to use unsupported options for the given compression algorithm.
     * Example:
     * <pre>
     * CALL COMPRESS(STRINGTOUTF8(SPACE(100)), 'DEFLATE l 10');
     * </pre>
     * Correct:
     * <pre>
     * CALL COMPRESS(STRINGTOUTF8(SPACE(100)), 'DEFLATE l 9');
     * </pre>
     */
    public static final int UNSUPPORTED_COMPRESSION_OPTIONS_1 = 90102;

    /**
     * The error with code <code>90103</code> is thrown when
     * trying to use an unsupported compression algorithm.
     * Example:
     * <pre>
     * CALL COMPRESS(STRINGTOUTF8(SPACE(100)), 'BZIP');
     * </pre>
     */
    public static final int UNSUPPORTED_COMPRESSION_ALGORITHM_1 = 90103;

    /**
     * The error with code <code>90104</code> is thrown when
     * the data can not be de-compressed.
     * Example:
     * <pre>
     * CALL EXPAND(X'00FF');
     * </pre>
     */
    public static final int COMPRESSION_ERROR = 90104;

    /**
     * The error with code <code>90105</code> is thrown when
     * an exception occured in a user defined method.
     * Example:
     * <pre>
     * CREATE ALIAS SYS_PROP FOR "java.lang.System.getProperty";
     * CALL SYS_PROP(NULL);
     * </pre>
     */
    public static final int EXCEPTION_IN_FUNCTION = 90105;

    /**
     * The error with code <code>90106</code> is thrown when
     * trying to truncate a table that can not be truncated.
     * Tables with referential integrity constraints can not be truncated.
     * Also, system tables and view can not be truncated.
     * Example:
     * <pre>
     * TRUNCATE TABLE INFORMATION_SCHEMA.SETTINGS;
     * </pre>
     */
    public static final int CANNOT_TRUNCATE_1 = 90106;

    /**
     * The error with code <code>90107</code> is thrown when
     * trying to drop an object because another object would become invalid.
     * Example:
     * <pre>
     * CREATE TABLE COUNT(X INT);
     * CREATE TABLE ITEMS(ID INT DEFAULT SELECT MAX(X)+1 FROM COUNT);
     * DROP TABLE COUNT;
     * </pre>
     */
    public static final int CANNOT_DROP_2 = 90107;

    /**
     * The error with code <code>90109</code> is thrown when
     * trying to run a query against an invalid view.
     * Example:
     * <pre>
     * CREATE FORCE VIEW TEST_VIEW AS SELECT * FROM TEST;
     * SELECT * FROM TEST_VIEW;
     * </pre>
     */
    public static final int VIEW_IS_INVALID_2 = 90109;

    /**
     * The error with code <code>90110</code> is thrown when
     * the result of the calculation does not fit in the given data type.
     * Example:
     * <pre>
     * CALL -CAST(-128 AS TINYINT);
     * </pre>
     */
    public static final int OVERFLOW_FOR_TYPE_1 = 90110;

    /**
     * The error with code <code>90111</code> is thrown when
     * an exception occured while accessing a linked table.
     */
    public static final int ERROR_ACCESSING_LINKED_TABLE_2 = 90111;

    /**
     * The error with code <code>90112</code> is thrown when a row was deleted
     * twice while locking was disabled. This is an intern exception that should
     * never be thrown to the application, because such deleted should be
     * detected and the resulting exception ignored inside the database engine.
     * <pre>
     * Row not found when trying to delete from index UID_INDEX_0
     * </pre>
     */
    public static final int ROW_NOT_FOUND_WHEN_DELETING_1 = 90112;

    /**
     * The error with code <code>90113</code> is thrown when
     * the database URL contains unsupported settings.
     * Example:
     * <pre>
     * jdbc:h2:~/test;UNKNOWN=TRUE
     * </pre>
     */
    public static final int UNSUPPORTED_SETTING_1 = 90113;

    /**
     * The error with code <code>90114</code> is thrown when
     * trying to create a constant if a constant with this name already exists.
     * Example:
     * <pre>
     * CREATE CONSTANT TEST VALUE 1;
     * CREATE CONSTANT TEST VALUE 1;
     * </pre>
     */
    public static final int CONSTANT_ALREADY_EXISTS_1 = 90114;

    /**
     * The error with code <code>90115</code> is thrown when
     * trying to drop a constant that does not exists.
     * Example:
     * <pre>
     * DROP CONSTANT UNKNOWN;
     * </pre>
     */
    public static final int CONSTANT_NOT_FOUND_1 = 90115;

    /**
     * The error with code <code>90116</code> is thrown when
     * trying use a literal in a SQL statement if literals are disabled.
     * If literals are disabled, use PreparedStatement and parameters instead
     * of literals in the SQL statement.
     * Example:
     * <pre>
     * SET ALLOW_LITERALS NONE;
     * CALL 1+1;
     * </pre>
     */
    public static final int LITERALS_ARE_NOT_ALLOWED = 90116;

    /**
     * The error with code <code>90117</code> is thrown when
     * trying to connect to a TCP server from another machine, if remote
     * connections are not allowed. To allow remote connections,
     * start the TCP server using the option -tcpAllowOthers true as in:
     * <pre>
     * java org.h2.tools.Server -tcp -tcpAllowOthers true
     * </pre>
     * Or, when starting the server from an application, use:
     * <pre>
     * Server server = Server.createTcpServer(new String[] { 
     *          "-tcpAllowOthers", "true" });
     * server.start();
     * </pre>
     */
    public static final int REMOTE_CONNECTION_NOT_ALLOWED = 90117;

    /**
     * The error with code <code>90118</code> is thrown when
     * trying to drop a table can not be dropped.
     * Example:
     * <pre>
     * DROP TABLE INFORMATION_SCHEMA.SETTINGS;
     * </pre>
     */
    public static final int CANNOT_DROP_TABLE_1  = 90118;

    /**
     * The error with code <code>90119</code> is thrown when
     * trying to create a domain if an object with this name already exists.
     * Example:
     * <pre>
     * CREATE DOMAIN EMAIL AS VARCHAR CHECK LOCATE('@', VALUE) > 0;
     * CREATE DOMAIN EMAIL AS VARCHAR CHECK LOCATE('@', VALUE) > 0;
     * </pre>
     */
    public static final int USER_DATA_TYPE_ALREADY_EXISTS_1 = 90119;

    /**
     * The error with code <code>90120</code> is thrown when
     * trying to drop a domain that doesn't exists.
     * Example:
     * <pre>
     * DROP DOMAIN UNKNOWN;
     * </pre>
     */
    public static final int USER_DATA_TYPE_NOT_FOUND_1 = 90120;

    /**
     * The error with code <code>90121</code> is thrown when
     * a database operation is started while the virtual machine exits
     * (for example in a shutdown hook), or when the session is closed.
     */
    public static final int DATABASE_CALLED_AT_SHUTDOWN = 90121;

    /**
     * The error with code <code>90122</code> is thrown when
     * trying to altering, adding or dropping columns of a table that has views.
     * Example:
     * <pre>
     * CREATE TABLE TEST(ID INT);
     * CREATE VIEW TEST_VIEW AS SELECT * FROM TEST;
     * ALTER TABLE TEST ADD COLUMN NAME VARCHAR;
     * </pre>
     */
    public static final int OPERATION_NOT_SUPPORTED_WITH_VIEWS_2 = 90122;

    /**
     * The error with code <code>90123</code> is thrown when
     * trying mix regular parameters and indexed parameters in the same statement.
     * Example:
     * <pre>
     * SELECT ?, ?1 FROM DUAL;
     * </pre>
     */
    public static final int CANNOT_MIX_INDEXED_AND_UNINDEXED_PARAMS = 90123;

    /**
     * The error with code <code>90124</code> is thrown when
     * trying to access a file that doesn't exist. This can occur when trying to
     * read a lob if the lob file has been deleted by another application.
     */
    public static final int FILE_NOT_FOUND_1 = 90124;

    /**
     * The error with code <code>90125</code> is thrown when
     * PreparedStatement.setBigDecimal is called
     * with object that extends the class BigDecimal, and the system property
     * h2.allowBigDecimalExtensions is not set. Using extensions of BigDecimal is
     * dangerous because the database relies on the behavior of BigDecimal.
     * <pre>
     * BigDecimal bd = new MyDecimal("$10.3");
     * prep.setBigDecimal(1, bd);
     * Invalid class, expected java.math.BigDecimal but got MyDecimal
     * </pre>
     * Correct:
     * <pre>
     * BigDecimal bd = new BigDecimal("10.3");
     * prep.setBigDecimal(1, bd);
     * </pre>
     */
    public static final int INVALID_CLASS_2 = 90125;

    /**
     * The error with code <code>90126</code> is thrown when
     * trying to call the BACKUP statement for an in-memory database.
     * Example:
     * <pre>
     * jdbc:h2:mem:
     * BACKUP TO 'test.zip';
     * </pre>
     */
    public static final int DATABASE_IS_NOT_PERSISTENT = 90126;

    /**
     * The error with code <code>90127</code> is thrown when
     * trying to update or delete a row in a result set if the result set is
     * not updatable.
     */
    public static final int RESULT_SET_NOT_UPDATABLE = 90127;

    /**
     * The error with code <code>90128</code> is thrown when
     * trying to call a method of the ResultSet that is only supported
     * for scrollable result sets, and the result set is not scrollable.
     * Example:
     * <pre>
     * rs.first();
     * </pre>
     */
    public static final int RESULT_SET_NOT_SCROLLABLE = 90128;

    /**
     * The error with code <code>90129</code> is thrown when
     * trying to commit a transaction that doesn't exist.
     * Example:
     * <pre>
     * PREPARE COMMIT ABC;
     * COMMIT TRANSACTION TEST;
     * </pre>
     */
    public static final int TRANSACTION_NOT_FOUND_1 = 90129;

    /**
     * The error with code <code>90130</code> is thrown when
     * an execute method of PreparedStatement was called with a SQL statement.
     * This is not allowed according to the JDBC specification. Instead, use
     * an execute method of Statement. Example:
     * <pre>
     * PreparedStatement prep = conn.prepareStatement("SELECT * FROM TEST");
     * prep.execute("DELETE FROM TEST");
     * </pre>
     * Correct:
     * <pre>
     * Statement stat = conn.createStatement();
     * stat.execute("DELETE FROM TEST");
     * </pre>
     */
    public static final int METHOD_NOT_ALLOWED_FOR_PREPARED_STATEMENT = 90130;

    /**
     * The error with code <code>90131</code> is thrown when
     * using multi version concurrency control, and trying to update the same
     * row from within two connections at the same time.
     * Example:
     * <pre>
     * jdbc:h2:~/test;MVCC=TRUE
     * Session 1:
     * CREATE TABLE TEST(ID INT);
     * INSERT INTO TEST VALUES(1);
     * SET AUTOCOMMIT FALSE;
     * UPDATE TEST SET ID = 2;
     * Session 2:
     * SET AUTOCOMMIT FALSE;
     * UPDATE TEST SET ID = 3;
     * </pre>
     */
    public static final int CONCURRENT_UPDATE_1 = 90131;

    /**
     * The error with code <code>90132</code> is thrown when
     * trying to drop a user defined aggregate function that doesn't exist.
     * Example:
     * <pre>
     * DROP AGGREGATE UNKNOWN;
     * </pre>
     */
    public static final int AGGREGATE_NOT_FOUND_1 = 90132;

    /**
     * The error with code <code>90133</code> is thrown when
     * trying to change a specific database property while the database is already
     * open. The MVCC property needs to be set in the first connection
     * (in the connection opening the database) and can not be changed later on.
     */
    public static final int CANNOT_CHANGE_SETTING_WHEN_OPEN_1 = 90133;

    /**
     * The error with code <code>90134</code> is thrown when
     * trying to load a Java class that is not part of the allowed classes.
     * By default, all classes are allowed, but this can be changed using the system
     * property h2.allowedClasses.
     */
    public static final int ACCESS_DENIED_TO_CLASS_1 = 90134;

    /**
     * The error with code <code>90135</code> is thrown when
     * trying to open a connection to a database that is currently open
     * in exclusive mode. The exclusive mode is set using:
     * <pre>
     * SET EXCLUSIVE TRUE;
     * </pre>
     */
    public static final int DATABASE_IS_IN_EXCLUSIVE_MODE = 90135;

    /**
     * The error with code <code>90136</code> is thrown when
     * executing a query that used an unsupported outer join condition.
     * Example:
     * <pre>
     * SELECT * FROM DUAL A LEFT JOIN DUAL B ON B.X=(SELECT MAX(X) FROM DUAL);
     * </pre>
     */
    public static final int UNSUPPORTED_OUTER_JOIN_CONDITION_1 = 90136;

    /**
     * The error with code <code>90137</code> is thrown when
     * trying to assign a value to something that is not a variable.
     * <pre>
     * SELECT AMOUNT, SET(@V, IFNULL(@V, 0)+AMOUNT) FROM TEST;
     * </pre>
     */
    public static final int CAN_ONLY_ASSIGN_TO_VARIABLE_1 = 90137;

    // next is 90108

    /**
     * INTERNAL
     */
    public static String getState(int errorCode) {
        // To convert SQLState to error code, replace
        // 21S: 210, 42S: 421, HY: 50, C: 1, T: 2

        switch (errorCode) {
        // 02: no data
        case NO_DATA_AVAILABLE: return "02000";

        // 07: dynamic SQL error
        case INVALID_PARAMETER_COUNT_2: return "07001";

        // 08: connection exception
        case ERROR_OPENING_DATABASE: return "08000";
        case WRONG_USER_OR_PASSWORD: return "08004";

        // 21: cardinality violation
        case COLUMN_COUNT_DOES_NOT_MATCH: return "21S02";

        // 42: syntax error or access rule violation
        case SYNTAX_ERROR_1: return "42000";
        case SYNTAX_ERROR_2: return "42001";
        case TABLE_OR_VIEW_ALREADY_EXISTS_1: return "42S01";
        case TABLE_OR_VIEW_NOT_FOUND_1: return "42S02";
        case INDEX_ALREADY_EXISTS_1: return "42S11";
        case INDEX_NOT_FOUND_1: return "42S12";
        case DUPLICATE_COLUMN_NAME_1: return "42S21";
        case COLUMN_NOT_FOUND_1: return "42S22";

        // 0A: feature not supported

        // HZ: remote database access

        // HY
        case GENERAL_ERROR_1: return "HY000";
        case UNKNOWN_DATA_TYPE_1: return "HY004";

        case FEATURE_NOT_SUPPORTED: return "HYC00";
        case LOCK_TIMEOUT_1: return "HYT00";
        default:
            return "" + errorCode;
        }
    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -