Package org.h2.api
Class ErrorCode
java.lang.Object
org.h2.api.ErrorCode
This class defines the error codes used for SQL exceptions.
Error messages are formatted as follows:
{ error message (possibly translated; may include quoted data) } { error message in English if different } { SQL statement if applicable } { [ error code - build number ] }Example:
Syntax error in SQL statement "SELECT * FORM[*] TEST "; SQL statement: select * form test [42000-125]The [*] marks the position of the syntax error (FORM instead of FROM in this case). The error code is 42000, and the build number is 125, meaning version 1.2.125.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The error with code90134
is thrown when trying to load a Java class that is not part of the allowed classes.static final int
The error with code90040
is thrown when a user that is not administrator tries to execute a statement that requires admin privileges.static final int
The error with code90132
is thrown when trying to drop a user-defined aggregate function that doesn't exist.static final int
The error with code90059
is thrown when a query contains a column that could belong to multiple tables.static final int
The error with code22034
is thrown when an attempt is made to read non-existing element of an array.static final int
The error with code90144
is thrown when user trying to login into a database with AUTHREALM set and the target database doesn't have an authenticator definedstatic final int
The error with code90137
is thrown when trying to assign a value to something that is not a variable.static final int
The error with code90133
is thrown when trying to change a specific database property while the database is already open.static final int
The error with code90107
is thrown when trying to drop an object because another object would become invalid.static final int
The error with code90019
is thrown when trying to drop the current user, if there are no other admin users.static final int
The error with code90084
is thrown when trying to drop the last column of a table.static final int
The error with code90118
is thrown when trying to drop a table can not be dropped.static final int
The error with code90123
is thrown when trying mix regular parameters and indexed parameters in the same statement.static final int
The error with code90106
is thrown when trying to truncate a table that can not be truncated.static final int
The error with code23514
is thrown when evaluation of a check constraint resulted in an error.static final int
The error with code23513
is thrown when a check constraint is violated.static final int
The error with code90086
is thrown when a class can not be loaded because it is not in the classpath or because a related class is not in the classpath.static final int
The error with code90093
is thrown when trying to connect to a clustered database that runs in standalone mode.static final int
The error with code90094
is thrown when trying to connect to a clustered database that runs together with a different cluster node setting than what is used when trying to connect.static final int
The error with code90089
is thrown when trying to change the collation while there was already data in the database.static final int
The error with code90156
is thrown when trying to create a view or a table from a select and some expression doesn't have a column name or alias when it is required by a compatibility mode.static final int
The error with code90081
is thrown when trying to alter a column to not allow NULL, if there is already data in the table where this column is NULL.static final int
The error with code21002
is thrown when the number of columns does not match.static final int
The error with code90075
is thrown when trying to alter a table and allow null for a column that is part of a primary key or hash index.static final int
The error with code90083
is thrown when trying to drop a column that is part of a constraint.static final int
The error with code90023
is thrown when trying to set a primary key on a nullable column or when trying to drop NOT NULL constraint on primary key or identity column.static final int
The error with code42122
is thrown when referencing an non-existing column.static final int
The error with code90058
is thrown when trying to call commit or rollback inside a trigger, or when trying to call a method inside a trigger that implicitly commits the current transaction, if an object is locked.static final int
The error with code90104
is thrown when the data can not be de-compressed.static final int
The error with code90131
is thrown when using multi version concurrency control, and trying to update the same row from within two connections at the same time, or trying to insert two rows with the same key from two connections.static final int
The error with code90067
is thrown when the client could not connect to the database, or if the connection was lost.static final int
The error with code90114
is thrown when trying to create a constant if a constant with this name already exists.static final int
The error with code90115
is thrown when trying to drop a constant that does not exists.static final int
The error with code90045
is thrown when trying to create a constraint if an object with this name already exists.static final int
The error with code90152
is thrown when trying to manually drop a unique or primary key constraint that is referenced by a foreign key constraint without a CASCADE clause.static final int
The error with code90057
is thrown when trying to drop a constraint that does not exist.static final int
The error with code90148
is thrown when trying to access the current value of a sequence before execution of NEXT VALUE FOR sequenceName in the current session.static final int
The error with code22018
is thrown when trying to convert a value to a data type where the conversion is undefined, or when an error occurred trying to convert.static final int
The error with code90020
is thrown when trying to open a database in embedded mode if this database is already in use in another process (or in a different class loader).static final int
The error with code90121
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.static final int
The error with code90098
is thrown when the database has been closed, for example because the system ran out of memory or because the self-destruction counter has reached zero.static final int
The error with code90135
is thrown when trying to open a connection to a database that is currently open in exclusive mode.static final int
The error with code90126
is thrown when trying to call the BACKUP statement for an in-memory database.static final int
The error with code90097
is thrown when trying to delete or update a database if it is open in read-only mode.static final int
The error with code90013
is thrown when when trying to access a database object with a catalog name that does not match the database name.static final int
The error with code90146
is thrown when trying to open a database that does not exist using the flag IFEXISTS=TRUEstatic final int
The error with code40001
is thrown when the database engine has detected a deadlock.static final int
The error with code90027
is thrown when an object could not be de-serialized.static final int
The error with code22012
is thrown when trying to divide a value by zero.static final int
The error with code90119
is thrown when trying to create a domain if an object with this name already exists, or when trying to overload a built-in data type.static final int
The error with code90120
is thrown when trying to drop a domain that doesn't exist.static final int
The error with code90047
is thrown when trying to connect to a TCP server with an incompatible client.static final int
The error with code42121
is thrown when trying to create a table or insert into a table and use the same column name twice.static final int
The error with code23505
is thrown when trying to insert a row that would violate a unique index or primary key.static final int
The error with code90066
is thrown when the same property appears twice in the database URL or in the connection properties.static final int
The error with code22033
is thrown when an attempt is made to add or modify an ENUM-typed column so that it would have duplicate values.static final int
The error with code22032
is thrown when an attempt is made to add or modify an ENUM-typed column so that one or more of its enumerators would be empty.static final int
The error with code22030
is thrown when an attempt is made to INSERT or UPDATE an ENUM-typed cell, but the value is not one of the values enumerated by the type.static final int
The error with code90111
is thrown when an exception occurred while accessing a linked table.static final int
The error with code90043
is thrown when there is an error initializing the trigger, for example because the class does not implement the Trigger interface.static final int
The error with code90044
is thrown when an exception or error occurred while calling the triggers fire method.static final int
The error with code8000
is thrown when there was a problem trying to create a database lock.static final int
The error with code90099
is thrown when an error occurred trying to initialize the database event listener.static final int
The error with code90105
is thrown when an exception occurred in a user-defined method.static final int
The error with code90061
is thrown when trying to start a server if a server is already running at the same port.static final int
The error with code50100
is thrown when calling an unsupported JDBC method or database feature.static final int
The error with code90030
is thrown when the database engine has detected a checksum mismatch in the data or index.static final int
The error with code90062
is thrown when a directory or file could not be created.static final int
The error with code90025
is thrown when a file could not be deleted, because it is still in use (only in Windows), or because an error occurred when deleting.static final int
The error with code90049
is thrown when trying to open an encrypted database with the wrong file encryption password or algorithm.static final int
The error with code90124
is thrown when trying to access a file that doesn't exist.static final int
The error with code90024
is thrown when a file could not be renamed.static final int
The error with code90048
is thrown when the file header of a database files (*.db) does not match the expected version, or if it is corrupted.static final int
The error with code90145
is thrown when trying to execute a SELECT statement with non-window aggregates, DISTINCT, GROUP BY, or HAVING clauses together with FOR UPDATE clause.static final int
The error with code90076
is thrown when trying to create a function alias for a system function or for a function that is already defined.static final int
The error with code90077
is thrown when trying to drop a system function or a function alias that does not exist.static final int
The error with code90000
is thrown when a function that does not return a result set was used in the FROM clause.static final int
The error with code90022
is thrown when trying to call a unknown function.static final int
The error with code50000
is thrown when something unexpected occurs, for example an internal stack overflow.static final int
The error with code90154
is thrown when trying to assign a value to a generated column.static final int
The error with code90155
is thrown when trying to create a referential constraint that can update a referenced generated column.static final int
The error with code90157
is thrown when the integer index that is used in the GROUP BY is not in the SELECT liststatic final int
The error with code90003
is thrown when trying to convert a String to a binary value.static final int
The error with code90004
is thrown when trying to convert a text to binary, but the expression contains a non-hexadecimal character.static final int
The error with code42131
is thrown when identical expressions should be used, but different expressions were found.static final int
The error with code42111
is thrown when trying to create an index if an index with the same name already exists.static final int
The error with code90085
is thrown when trying to manually drop an index that was generated by the system because of a unique or referential constraint.static final int
The error with code42112
is thrown when trying to drop or reference an index that does not exist.static final int
The error with code90125
is thrown when PreparedStatement.setBigDecimal is called with object that extends the class BigDecimal.static final int
The error with code90138
is thrown when trying to open a persistent database using an incorrect database name.static final int
The error with code22007
is thrown when a text can not be converted to a date, time, or timestamp constant.static final int
The error with code42602
is thrown when invalid name of identifier is used.static final int
The error with code7001
is thrown when trying to call a function with the wrong number of parameters.static final int
The error with code22013
is thrown when preceding or following size in a window function is null or negative.static final int
The error with code90010
is thrown when trying to format a timestamp or number using TO_CHAR with an invalid format.static final int
The error with code90056
is thrown when trying to format a timestamp using TO_DATE and TO_TIMESTAMP with an invalid format.static final int
The error with code90005
is thrown when trying to create a trigger with invalid combination of flags.static final int
The error with code90054
is thrown when an aggregate function is used where it is not allowed.static final int
The error with code90008
is thrown when trying to use a value that is not valid for the given operation.static final int
The error with code90150
is thrown when trying to use an invalid precision.static final int
The error with code90151
is thrown when trying to use an invalid scale or fractional seconds precision.static final int
The error with code90028
is thrown when an input / output error occurred.static final int
The error with code90031
is thrown when an input / output error occurred.static final int
The error with code90141
is thrown when trying to change the java object serializer while there was already data in the database.static final int
The error with code22025
is thrown when using an invalid escape character sequence for LIKE or REGEXP.static final int
The error with code90116
is thrown when trying use a literal in a SQL statement if literals are disabled.static final int
The error with code90039
is thrown when trying to access a CLOB or BLOB object that timed out.static final int
The error with code50200
is thrown when another connection locked an object longer than the lock timeout set for this connection, or when a deadlock occurred.static final int
The error with code90147
is thrown when trying to execute a statement which closes the transaction (such as commit and rollback) and autocommit mode is on.static final int
The error with code90130
is thrown when an execute method of PreparedStatement was called with a SQL statement.static final int
The error with code90001
is thrown when Statement.executeUpdate() was called for a SELECT statement.static final int
The error with code90087
is thrown when a method with matching number of arguments was not found in the class.static final int
The error with code90002
is thrown when Statement.executeQuery() was called for a statement that does not return a result set (for example, an UPDATE statement).static final int
The error with code90073
is thrown when trying to create an alias for a Java method, if two methods exists in this class that have this name and the same number of parameters.static final int
The error with code90016
is thrown when a column was used in the expression list or the order by clause of a group or aggregate query, and that column is not in the GROUP BY clause.static final int
The error with code42622
is thrown when name of identifier is too long.static final int
The error with code2000
is thrown when the result set is positioned before the first or after the last row, or not on a valid row for the given operation.static final int
The error with code23507
is thrown when updating or deleting from a table with a foreign key constraint that should set the default value, but there is no default value defined.static final int
The error with code90096
is thrown when trying to perform an operation with a non-admin user if the user does not have enough rights.static final int
The error with code90029
is thrown when calling ResultSet.deleteRow(), insertRow(), or updateRow() when the current row is not updatable.static final int
The error with code23502
is thrown when trying to insert NULL into a column that does not allow NULL.static final int
The error with code22035
is thrown when an attempt is made to update an element in NULL array.static final int
The error with code22003
is thrown when a value is out of range when converting to another data type.static final int
The error with code22004
is thrown when a value is out of range when converting to another column's data type.static final int
The error with code90007
is thrown when trying to call a JDBC method on an object that has been closed.static final int
The error with code90068
is thrown when the given expression that is used in the ORDER BY is not in the result list.static final int
The error with code90108
is thrown when not enough heap memory was available.static final int
The error with code90012
is thrown when trying to execute a statement with an parameter.static final int
The error with code90014
is thrown when trying to parse a date with an unsupported format string, or when the date can not be parsed.static final int
The error with code90139
is thrown when the specified public static Java method was not found in the class.static final int
The error with code23503
is thrown when trying to delete or update a row when this would violate a referential constraint, because there is a child row that would become an orphan.static final int
The error with code23506
is thrown when trying to insert or update a row that would violate a referential constraint, because the referenced row does not exist.static final int
The error with code90117
is thrown when trying to connect to a TCP server from another machine, if remote connections are not allowed.static final int
The error with code90149
is thrown when trying to open a database that does not exist remotely without enabling remote database creation first.static final int
The error with code90128
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.static final int
The error with code90127
is thrown when trying to update or delete a row in a result set if the result set is not updatable.static final int
The error with code90140
is thrown when trying to update or delete a row in a result set if the statement was not created with updatable concurrency.static final int
The error with code90069
is thrown when trying to create a role if an object with this name already exists.static final int
The error with code90074
is thrown when trying to grant a role that has already been granted.static final int
The error with code90091
is thrown when trying to drop the role PUBLIC.static final int
The error with code90070
is thrown when trying to drop or grant a role that does not exists.static final int
The error with code90072
is thrown when trying to grant or revoke both roles and rights at the same time.static final int
The error with code90143
is thrown when trying to fetch a row from the primary index and the row is not there.static final int
The error with code90112
is thrown when a row was deleted twice while locking was disabled.static final int
The error with code90063
is thrown when trying to rollback to a savepoint that is not defined.static final int
The error with code90065
is thrown when Savepoint.getSavepointId() is called on a named savepoint.static final int
The error with code90064
is thrown when Savepoint.getSavepointName() is called on an unnamed savepoint.static final int
The error with code90053
is thrown when a subquery that is used as a value contains more than one row.static final int
The error with code90078
is thrown when trying to create a schema if an object with this name already exists.static final int
The error with code90090
is thrown when trying to drop a schema that may not be dropped (the schema PUBLIC and the schema INFORMATION_SCHEMA).static final int
The error with code90080
is thrown when trying to rename a object to a different schema, or when trying to create a related object in another schema.static final int
The error with code90079
is thrown when trying to drop a schema that does not exist.static final int
The error with code90017
is thrown when trying to define a second primary key constraint for this table.static final int
The error with code90035
is thrown when trying to create a sequence if a sequence with this name already exists.static final int
The error with code90009
is thrown when trying to create a sequence with an invalid combination of attributes (min value, max value, start value, etc).static final int
The error with code90082
is thrown when trying to drop a system generated sequence.static final int
The error with code90006
is thrown when trying to get a value from a sequence that has run out of numbers and does not have cycling enabled.static final int
The error with code90036
is thrown when trying to access a sequence that does not exist.static final int
The error with code90026
is thrown when an object could not be serialized.static final int
The error with code57014
is thrown when a statement was canceled using Statement.cancel() or when the query timeout has been reached.static final int
The error with code90142
is thrown when trying to set zero for step size.static final int
The error with code90095
is thrown when calling the method STRINGDECODE with an invalid escape sequence.static final int
The error with code90052
is thrown when a single-column subquery is expected but a subquery with other number of columns was specified.static final int
The error with code90015
is thrown when using an aggregate function with a data type that is not supported.static final int
The error with code42000
is thrown when trying to execute an invalid SQL statement.static final int
The error with code42001
is thrown when trying to execute an invalid SQL statement.static final int
The error with code42101
is thrown when trying to create a table or view if an object with this name already exists.static final int
The error with code42102
is thrown when trying to query, modify or drop a table or view that does not exists in this schema and database.static final int
The error with code42104
is thrown when trying to query, modify or drop a table or view that does not exists in this schema and database but it is empty anyway.static final int
The error with code42103
is thrown when trying to query, modify or drop a table or view that does not exists in this schema and database but similar names were found.static final int
The error with code54011
is thrown when too many columns were specified in a table, select statement, or row value.static final int
The error with code90018
is thrown when the connection was opened, but never closed.static final int
The error with code90034
is thrown when writing to the trace file failed, for example because the there is an I/O exception.static final int
The error with code90129
is thrown when trying to commit a transaction that doesn't exist.static final int
The error with code90041
is thrown when trying to create a trigger and there is already a trigger with that name.static final int
The error with code90042
is thrown when trying to drop a trigger that does not exist.static final int
The error with code90110
is thrown when trying to compare or combine values of incomparable data types.static final int
The error with code90153
is thrown when trying to reference a column of another data type when data types aren't comparable or don't have a session-independent compare order between each other.static final int
The error with code50004
is thrown when creating a table with an unsupported data type, or when the data type is unknown because parameters are used.static final int
The error with code90088
is thrown when trying to switch to an unknown mode.static final int
The error with code90055
is thrown when trying to open a database with an unsupported cipher algorithm.static final int
The error with code90103
is thrown when trying to use an unsupported compression algorithm.static final int
The error with code90102
is thrown when trying to use unsupported options for the given compression algorithm.static final int
The error with code90060
is thrown when trying to use a file locking mechanism that is not supported.static final int
The error with code90113
is thrown when the database URL contains unsupported settings.static final int
The error with code90021
is thrown when trying to change a specific database property that conflicts with other database properties.static final int
The error with code90046
is thrown when trying to open a connection to a database using an unsupported URL format.static final int
The error with code90011
is thrown when trying to open a connection to a database using an implicit relative path, such as "jdbc:h2:test" (in which case the database file would be stored in the current working directory of the application).static final int
The error with code90033
is thrown when trying to create a user or role if a user with this name already exists.static final int
Deprecated.static final int
Deprecated.static final int
The error with code90032
is thrown when trying to drop or alter a user that does not exist.static final int
The error with code90071
is thrown when trying to grant or revoke if no role or user with that name exists.static final int
The error with code22001
is thrown when trying to insert a value that is too long for the column.static final int
The error with code90038
is thrown when trying to create a view if a view with this name already exists.static final int
The error with code90109
is thrown when trying to run a query against an invalid view.static final int
The error with code90037
is thrown when trying to drop or alter a view that does not exist.static final int
The error with code90136
is thrown when trying to reference a window that does not exist.static final int
The error with code90122
is thrown when WITH TIES clause is used without ORDER BY clause.static final int
The error with code90050
is thrown when trying to open an encrypted database, but not separating the file password from the user password.static final int
The error with code28000
is thrown when there is no such user registered in the database, when the user password does not match, or when the database encryption password does not match (if database encryption is used).static final int
The error with code90101
is thrown when the XA API detected unsupported transaction names. -
Method Summary
-
Field Details
-
NO_DATA_AVAILABLE
public static final int NO_DATA_AVAILABLEThe error with code2000
is thrown when the result set is positioned before the first or after the last row, or not on a valid row for the given operation. Example of wrong usage:ResultSet rs = stat.executeQuery("SELECT * FROM DUAL"); rs.getString(1);
Correct:ResultSet rs = stat.executeQuery("SELECT * FROM DUAL"); rs.next(); rs.getString(1);
- See Also:
-
INVALID_PARAMETER_COUNT_2
public static final int INVALID_PARAMETER_COUNT_2The error with code7001
is thrown when trying to call a function with the wrong number of parameters. Example:CALL ABS(1, 2)
- See Also:
-
ERROR_OPENING_DATABASE_1
public static final int ERROR_OPENING_DATABASE_1The error with code8000
is thrown when there was a problem trying to create a database lock. See the message and cause for details.- See Also:
-
COLUMN_COUNT_DOES_NOT_MATCH
public static final int COLUMN_COUNT_DOES_NOT_MATCHThe error with code21002
is thrown when the number of columns does not match. Possible reasons are: for an INSERT or MERGE statement, the column count does not match the table or the column list specified. For a SELECT UNION statement, both queries return a different number of columns. For a constraint, the number of referenced and referencing columns does not match. Example:CREATE TABLE TEST(ID INT, NAME VARCHAR); INSERT INTO TEST VALUES('Hello');
- See Also:
-
VALUE_TOO_LONG_2
public static final int VALUE_TOO_LONG_2The error with code22001
is thrown when trying to insert a value that is too long for the column. Example:CREATE TABLE TEST(ID INT, NAME VARCHAR(2)); INSERT INTO TEST VALUES(1, 'Hello');
- See Also:
-
NUMERIC_VALUE_OUT_OF_RANGE_1
public static final int NUMERIC_VALUE_OUT_OF_RANGE_1The error with code22003
is thrown when a value is out of range when converting to another data type. Example:CALL CAST(1000000 AS TINYINT); SELECT CAST(124.34 AS DECIMAL(2, 2));
- See Also:
-
NUMERIC_VALUE_OUT_OF_RANGE_2
public static final int NUMERIC_VALUE_OUT_OF_RANGE_2The error with code22004
is thrown when a value is out of range when converting to another column's data type.- See Also:
-
INVALID_DATETIME_CONSTANT_2
public static final int INVALID_DATETIME_CONSTANT_2The error with code22007
is thrown when a text can not be converted to a date, time, or timestamp constant. Examples:CALL DATE '2007-January-01'; CALL TIME '14:61:00'; CALL TIMESTAMP '2001-02-30 12:00:00';
- See Also:
-
DIVISION_BY_ZERO_1
public static final int DIVISION_BY_ZERO_1The error with code22012
is thrown when trying to divide a value by zero. Example:CALL 1/0;
- See Also:
-
INVALID_PRECEDING_OR_FOLLOWING_1
public static final int INVALID_PRECEDING_OR_FOLLOWING_1The error with code22013
is thrown when preceding or following size in a window function is null or negative. Example:FIRST_VALUE(N) OVER(ORDER BY N ROWS -1 PRECEDING)
- See Also:
-
DATA_CONVERSION_ERROR_1
public static final int DATA_CONVERSION_ERROR_1The error with code22018
is thrown when trying to convert a value to a data type where the conversion is undefined, or when an error occurred trying to convert. Example:CALL CAST(DATE '2001-01-01' AS BOOLEAN); CALL CAST('CHF 99.95' AS INT);
- See Also:
-
LIKE_ESCAPE_ERROR_1
public static final int LIKE_ESCAPE_ERROR_1The error with code22025
is thrown when using an invalid escape character sequence for LIKE or REGEXP. The default escape character is '\'. The escape character is required when searching for the characters '%', '_' and the escape character itself. That means if you want to search for the text '10%', you need to use LIKE '10\%'. If you want to search for 'C:\temp' you need to use 'C:\\temp'. The escape character can be changed using the ESCAPE clause as in LIKE '10+%' ESCAPE '+'. Example of wrong usage:CALL 'C:\temp' LIKE 'C:\temp'; CALL '1+1' LIKE '1+1' ESCAPE '+';
Correct:CALL 'C:\temp' LIKE 'C:\\temp'; CALL '1+1' LIKE '1++1' ESCAPE '+';
- See Also:
-
ENUM_VALUE_NOT_PERMITTED
public static final int ENUM_VALUE_NOT_PERMITTEDThe error with code22030
is thrown when an attempt is made to INSERT or UPDATE an ENUM-typed cell, but the value is not one of the values enumerated by the type. Example:CREATE TABLE TEST(CASE ENUM('sensitive','insensitive')); INSERT INTO TEST VALUES('snake');
- See Also:
-
ENUM_EMPTY
public static final int ENUM_EMPTYThe error with code22032
is thrown when an attempt is made to add or modify an ENUM-typed column so that one or more of its enumerators would be empty. Example:CREATE TABLE TEST(CASE ENUM(' '));
- See Also:
-
ENUM_DUPLICATE
public static final int ENUM_DUPLICATEThe error with code22033
is thrown when an attempt is made to add or modify an ENUM-typed column so that it would have duplicate values. Example:CREATE TABLE TEST(CASE ENUM('sensitive', 'sensitive'));
- See Also:
-
ARRAY_ELEMENT_ERROR_2
public static final int ARRAY_ELEMENT_ERROR_2The error with code22034
is thrown when an attempt is made to read non-existing element of an array. Example:VALUES ARRAY[1, 2][3]
- See Also:
-
NULL_VALUE_IN_ARRAY_TARGET
public static final int NULL_VALUE_IN_ARRAY_TARGETThe error with code22035
is thrown when an attempt is made to update an element in NULL array. Example:CREATE TABLE TEST(A INTEGER ARRAY) AS VALUES NULL; UPDATE TEST SET A[1] = 2;
- See Also:
-
NULL_NOT_ALLOWED
public static final int NULL_NOT_ALLOWEDThe error with code23502
is thrown when trying to insert NULL into a column that does not allow NULL. Example:CREATE TABLE TEST(ID INT, NAME VARCHAR NOT NULL); INSERT INTO TEST(ID) VALUES(1);
- See Also:
-
REFERENTIAL_INTEGRITY_VIOLATED_CHILD_EXISTS_1
public static final int REFERENTIAL_INTEGRITY_VIOLATED_CHILD_EXISTS_1The error with code23503
is thrown when trying to delete or update a row when this would violate a referential constraint, because there is a child row that would become an orphan. Example:CREATE TABLE TEST(ID INT PRIMARY KEY, PARENT INT); INSERT INTO TEST VALUES(1, 1), (2, 1); ALTER TABLE TEST ADD CONSTRAINT TEST_ID_PARENT FOREIGN KEY(PARENT) REFERENCES TEST(ID) ON DELETE RESTRICT; DELETE FROM TEST WHERE ID = 1;
- See Also:
-
DUPLICATE_KEY_1
public static final int DUPLICATE_KEY_1The error with code23505
is thrown when trying to insert a row that would violate a unique index or primary key. Example:CREATE TABLE TEST(ID INT PRIMARY KEY); INSERT INTO TEST VALUES(1); INSERT INTO TEST VALUES(1);
- See Also:
-
REFERENTIAL_INTEGRITY_VIOLATED_PARENT_MISSING_1
public static final int REFERENTIAL_INTEGRITY_VIOLATED_PARENT_MISSING_1The error with code23506
is thrown when trying to insert or update a row that would violate a referential constraint, because the referenced row does not exist. Example:CREATE TABLE PARENT(ID INT PRIMARY KEY); CREATE TABLE CHILD(P_ID INT REFERENCES PARENT(ID)); INSERT INTO CHILD VALUES(1);
- See Also:
-
NO_DEFAULT_SET_1
public static final int NO_DEFAULT_SET_1The error with code23507
is thrown when updating or deleting from a table with a foreign key constraint that should set the default value, but there is no default value defined. Example:CREATE TABLE TEST(ID INT PRIMARY KEY, PARENT INT); INSERT INTO TEST VALUES(1, 1), (2, 1); ALTER TABLE TEST ADD CONSTRAINT TEST_ID_PARENT FOREIGN KEY(PARENT) REFERENCES TEST(ID) ON DELETE SET DEFAULT; DELETE FROM TEST WHERE ID = 1;
- See Also:
-
CHECK_CONSTRAINT_VIOLATED_1
public static final int CHECK_CONSTRAINT_VIOLATED_1The error with code23513
is thrown when a check constraint is violated. Example:CREATE TABLE TEST(ID INT CHECK (ID>0)); INSERT INTO TEST VALUES(0);
- See Also:
-
CHECK_CONSTRAINT_INVALID
public static final int CHECK_CONSTRAINT_INVALIDThe error with code23514
is thrown when evaluation of a check constraint resulted in an error.- See Also:
-
WRONG_USER_OR_PASSWORD
public static final int WRONG_USER_OR_PASSWORDThe error with code28000
is thrown when there is no such user registered in the database, when the user password does not match, or when the database encryption password does not match (if database encryption is used).- See Also:
-
DEADLOCK_1
public static final int DEADLOCK_1The error with code40001
is thrown when the database engine has detected a deadlock. The transaction of this session has been rolled back to solve the problem. A deadlock occurs when a session tries to lock a table another session has locked, while the other session wants to lock a table the first session has locked. As an example, session 1 has locked table A, while session 2 has locked table B. If session 1 now tries to lock table B and session 2 tries to lock table A, a deadlock has occurred. Deadlocks that involve more than two sessions are also possible. To solve deadlock problems, an application should lock tables always in the same order, such as always lock table A before locking table B. For details, see Wikipedia Deadlock.- See Also:
-
SYNTAX_ERROR_1
public static final int SYNTAX_ERROR_1The error with code42000
is thrown when trying to execute an invalid SQL statement. Example:CREATE ALIAS REMAINDER FOR "IEEEremainder";
- See Also:
-
SYNTAX_ERROR_2
public static final int SYNTAX_ERROR_2The error with code42001
is thrown when trying to execute an invalid SQL statement. Example:CREATE TABLE TEST(ID INT); INSERT INTO TEST(1);
- See Also:
-
TABLE_OR_VIEW_ALREADY_EXISTS_1
public static final int TABLE_OR_VIEW_ALREADY_EXISTS_1The error with code42101
is thrown when trying to create a table or view if an object with this name already exists. Example:CREATE TABLE TEST(ID INT); CREATE TABLE TEST(ID INT PRIMARY KEY);
- See Also:
-
TABLE_OR_VIEW_NOT_FOUND_1
public static final int TABLE_OR_VIEW_NOT_FOUND_1The error with code42102
is thrown when trying to query, modify or drop a table or view that does not exists in this schema and database. A common cause is that the wrong database was opened. Example:SELECT * FROM ABC;
- See Also:
-
TABLE_OR_VIEW_NOT_FOUND_WITH_CANDIDATES_2
public static final int TABLE_OR_VIEW_NOT_FOUND_WITH_CANDIDATES_2The error with code42103
is thrown when trying to query, modify or drop a table or view that does not exists in this schema and database but similar names were found. A common cause is that the names are written in different case. Example:SELECT * FROM ABC;
- See Also:
-
TABLE_OR_VIEW_NOT_FOUND_DATABASE_EMPTY_1
public static final int TABLE_OR_VIEW_NOT_FOUND_DATABASE_EMPTY_1The error with code42104
is thrown when trying to query, modify or drop a table or view that does not exists in this schema and database but it is empty anyway. A common cause is that the wrong database was opened. Example:SELECT * FROM ABC;
- See Also:
-
INDEX_ALREADY_EXISTS_1
public static final int INDEX_ALREADY_EXISTS_1The error with code42111
is thrown when trying to create an index if an index with the same name already exists. Example:CREATE TABLE TEST(ID INT, NAME VARCHAR); CREATE INDEX IDX_ID ON TEST(ID); CREATE TABLE ADDRESS(ID INT); CREATE INDEX IDX_ID ON ADDRESS(ID);
- See Also:
-
INDEX_NOT_FOUND_1
public static final int INDEX_NOT_FOUND_1The error with code42112
is thrown when trying to drop or reference an index that does not exist. Example:DROP INDEX ABC;
- See Also:
-
DUPLICATE_COLUMN_NAME_1
public static final int DUPLICATE_COLUMN_NAME_1The error with code42121
is thrown when trying to create a table or insert into a table and use the same column name twice. Example:CREATE TABLE TEST(ID INT, ID INT);
- See Also:
-
COLUMN_NOT_FOUND_1
public static final int COLUMN_NOT_FOUND_1The error with code42122
is thrown when referencing an non-existing column. Example:CREATE TABLE TEST(ID INT); SELECT NAME FROM TEST;
- See Also:
-
IDENTICAL_EXPRESSIONS_SHOULD_BE_USED
public static final int IDENTICAL_EXPRESSIONS_SHOULD_BE_USEDThe error with code42131
is thrown when identical expressions should be used, but different expressions were found. Example:SELECT MODE(A ORDER BY B) FROM TEST;
- See Also:
-
INVALID_NAME_1
public static final int INVALID_NAME_1The error with code42602
is thrown when invalid name of identifier is used. Example:statement.enquoteIdentifier("\"", true);
- See Also:
-
NAME_TOO_LONG_2
public static final int NAME_TOO_LONG_2The error with code42622
is thrown when name of identifier is too long. Example:char[] c = new char[1000]; Arrays.fill(c, 'A'); statement.executeQuery("SELECT 1 " + new String(c));
- See Also:
-
TOO_MANY_COLUMNS_1
public static final int TOO_MANY_COLUMNS_1The error with code54011
is thrown when too many columns were specified in a table, select statement, or row value. Example:CREATE TABLE TEST(C1 INTEGER, C2 INTEGER, ..., C20000 INTEGER);
- See Also:
-
GENERAL_ERROR_1
public static final int GENERAL_ERROR_1The error with code50000
is thrown when something unexpected occurs, for example an internal stack overflow. For details about the problem, see the cause of the exception in the stack trace.- See Also:
-
UNKNOWN_DATA_TYPE_1
public static final int UNKNOWN_DATA_TYPE_1The error with code50004
is thrown when creating a table with an unsupported data type, or when the data type is unknown because parameters are used. Example:CREATE TABLE TEST(ID VERYSMALLINT);
- See Also:
-
FEATURE_NOT_SUPPORTED_1
public static final int FEATURE_NOT_SUPPORTED_1The error with code50100
is thrown when calling an unsupported JDBC method or database feature. See the stack trace for details.- See Also:
-
LOCK_TIMEOUT_1
public static final int LOCK_TIMEOUT_1The error with code50200
is thrown when another connection locked an object longer than the lock timeout set for this connection, or when a deadlock occurred. Example:CREATE TABLE TEST(ID INT); -- connection 1: SET AUTOCOMMIT FALSE; INSERT INTO TEST VALUES(1); -- connection 2: SET AUTOCOMMIT FALSE; INSERT INTO TEST VALUES(1);
- See Also:
-
STATEMENT_WAS_CANCELED
public static final int STATEMENT_WAS_CANCELEDThe error with code57014
is thrown when a statement was canceled using Statement.cancel() or when the query timeout has been reached. Examples:stat.setQueryTimeout(1); stat.cancel();
- See Also:
-
FUNCTION_MUST_RETURN_RESULT_SET_1
public static final int FUNCTION_MUST_RETURN_RESULT_SET_1The error with code90000
is thrown when a function that does not return a result set was used in the FROM clause. Example:SELECT * FROM SIN(1);
- See Also:
-
METHOD_NOT_ALLOWED_FOR_QUERY
public static final int METHOD_NOT_ALLOWED_FOR_QUERYThe error with code90001
is thrown when Statement.executeUpdate() was called for a SELECT statement. This is not allowed according to the JDBC specs.- See Also:
-
METHOD_ONLY_ALLOWED_FOR_QUERY
public static final int METHOD_ONLY_ALLOWED_FOR_QUERYThe error with code90002
is thrown when Statement.executeQuery() was called for a statement that does not return a result set (for example, an UPDATE statement). This is not allowed according to the JDBC specs.- See Also:
-
HEX_STRING_ODD_1
public static final int HEX_STRING_ODD_1The error with code90003
is thrown when trying to convert a String to a binary value. Two hex digits per byte are required. Example of wrong usage:CALL X'00023'; Hexadecimal string with odd number of characters: 00023
Correct:CALL X'000023';
- See Also:
-
HEX_STRING_WRONG_1
public static final int HEX_STRING_WRONG_1The error with code90004
is thrown when trying to convert a text to binary, but the expression contains a non-hexadecimal character. Example:CALL X'ABCDEFGH'; CALL CAST('ABCDEFGH' AS BINARY);
Conversion from text to binary is supported, but the text must represent the hexadecimal encoded bytes.- See Also:
-
INVALID_TRIGGER_FLAGS_1
public static final int INVALID_TRIGGER_FLAGS_1The error with code90005
is thrown when trying to create a trigger with invalid combination of flags.- See Also:
-
SEQUENCE_EXHAUSTED
public static final int SEQUENCE_EXHAUSTEDThe error with code90006
is thrown when trying to get a value from a sequence that has run out of numbers and does not have cycling enabled.- See Also:
-
OBJECT_CLOSED
public static final int OBJECT_CLOSEDThe error with code90007
is thrown when trying to call a JDBC method on an object that has been closed.- See Also:
-
INVALID_VALUE_2
public static final int INVALID_VALUE_2The error with code90008
is thrown when trying to use a value that is not valid for the given operation. Example:CREATE SEQUENCE TEST INCREMENT 0;
- See Also:
-
SEQUENCE_ATTRIBUTES_INVALID_7
public static final int SEQUENCE_ATTRIBUTES_INVALID_7The error with code90009
is thrown when trying to create a sequence with an invalid combination of attributes (min value, max value, start value, etc).- See Also:
-
INVALID_TO_CHAR_FORMAT
public static final int INVALID_TO_CHAR_FORMATThe error with code90010
is thrown when trying to format a timestamp or number using TO_CHAR with an invalid format.- See Also:
-
URL_RELATIVE_TO_CWD
public static final int URL_RELATIVE_TO_CWDThe error with code90011
is thrown when trying to open a connection to a database using an implicit relative path, such as "jdbc:h2:test" (in which case the database file would be stored in the current working directory of the application). This is not allowed because it can lead to confusion where the database file is, and can result in multiple databases because different working directories are used. Instead, use "jdbc:h2:~/name" (relative to the current user home directory), use an absolute path, set the base directory (baseDir), use "jdbc:h2:./name" (explicit relative path), or set the system property "h2.implicitRelativePath" to "true" (to prevent this check). For Windows, an absolute path also needs to include the drive ("C:/..."). Please see the documentation on the supported URL format. Example:jdbc:h2:test
- See Also:
-
PARAMETER_NOT_SET_1
public static final int PARAMETER_NOT_SET_1The error with code90012
is thrown when trying to execute a statement with an parameter. Example:CALL SIN(?);
- See Also:
-
DATABASE_NOT_FOUND_1
public static final int DATABASE_NOT_FOUND_1The error with code90013
is thrown when when trying to access a database object with a catalog name that does not match the database name.SELECT * FROM database_that_does_not_exist.table_name
- See Also:
-
PARSE_ERROR_1
public static final int PARSE_ERROR_1The error with code90014
is thrown when trying to parse a date with an unsupported format string, or when the date can not be parsed. Example:CALL PARSEDATETIME('2001 January', 'yyyy mm');
- See Also:
-
SUM_OR_AVG_ON_WRONG_DATATYPE_1
public static final int SUM_OR_AVG_ON_WRONG_DATATYPE_1The error with code90015
is thrown when using an aggregate function with a data type that is not supported. Example:SELECT SUM('Hello') FROM DUAL;
- See Also:
-
MUST_GROUP_BY_COLUMN_1
public static final int MUST_GROUP_BY_COLUMN_1The error with code90016
is thrown when a column was used in the expression list or the order by clause of a group or aggregate query, and that column is not in the GROUP BY clause. Example of wrong usage:CREATE TABLE TEST(ID INT, NAME VARCHAR); INSERT INTO TEST VALUES(1, 'Hello'), (2, 'World'); SELECT ID, MAX(NAME) FROM TEST; Column ID must be in the GROUP BY list.
Correct:SELECT ID, MAX(NAME) FROM TEST GROUP BY ID;
- See Also:
-
SECOND_PRIMARY_KEY
public static final int SECOND_PRIMARY_KEYThe error with code90017
is thrown when trying to define a second primary key constraint for this table. Example:CREATE TABLE TEST(ID INT PRIMARY KEY, NAME VARCHAR); ALTER TABLE TEST ADD CONSTRAINT PK PRIMARY KEY(NAME);
- See Also:
-
TRACE_CONNECTION_NOT_CLOSED
public static final int TRACE_CONNECTION_NOT_CLOSEDThe error with code90018
is thrown when the connection was opened, but never closed. In the finalizer of the connection, this forgotten close was detected and the connection was closed automatically, but relying on the finalizer is not good practice as it is not guaranteed and behavior is virtual machine dependent. The application should close the connection. This exception only appears in the .trace.db file. Example of wrong usage:Connection conn; conn = DriverManager.getConnection("jdbc:h2:˜/test"); conn = null; The connection was not closed by the application and is garbage collected
Correct:conn.close();
- See Also:
-
CANNOT_DROP_CURRENT_USER
public static final int CANNOT_DROP_CURRENT_USERThe error with code90019
is thrown when trying to drop the current user, if there are no other admin users. Example:DROP USER SA;
- See Also:
-
DATABASE_ALREADY_OPEN_1
public static final int DATABASE_ALREADY_OPEN_1The error with code90020
is thrown when trying to open a database in embedded mode if this database is already in use in another process (or in a different class loader). Multiple connections to the same database are supported in the following cases:- In embedded mode (URL of the form jdbc:h2:~/test) if all connections are opened within the same process and class loader.
- In server and cluster mode (URL of the form jdbc:h2:tcp://localhost/test) using remote connections.
- See Also:
-
UNSUPPORTED_SETTING_COMBINATION
public static final int UNSUPPORTED_SETTING_COMBINATIONThe error with code90021
is thrown when trying to change a specific database property that conflicts with other database properties.- See Also:
-
FUNCTION_NOT_FOUND_1
public static final int FUNCTION_NOT_FOUND_1The error with code90022
is thrown when trying to call a unknown function. Example:CALL SPECIAL_SIN(10);
- See Also:
-
COLUMN_MUST_NOT_BE_NULLABLE_1
public static final int COLUMN_MUST_NOT_BE_NULLABLE_1The error with code90023
is thrown when trying to set a primary key on a nullable column or when trying to drop NOT NULL constraint on primary key or identity column. Examples:CREATE TABLE TEST(ID INT, NAME VARCHAR); ALTER TABLE TEST ADD CONSTRAINT PK PRIMARY KEY(ID);
CREATE TABLE TEST(ID INT PRIMARY KEY, NAME VARCHAR); ALTER TABLE TEST ALTER COLUMN ID DROP NOT NULL;
CREATE TABLE TEST(ID INT GENERATED ALWAYS AS IDENTITY, NAME VARCHAR); ALTER TABLE TEST ALTER COLUMN ID DROP NOT NULL;
- See Also:
-
FILE_RENAME_FAILED_2
public static final int FILE_RENAME_FAILED_2The error with code90024
is thrown when a file could not be renamed.- See Also:
-
FILE_DELETE_FAILED_1
public static final int FILE_DELETE_FAILED_1The error with code90025
is thrown when a file could not be deleted, because it is still in use (only in Windows), or because an error occurred when deleting.- See Also:
-
SERIALIZATION_FAILED_1
public static final int SERIALIZATION_FAILED_1The error with code90026
is thrown when an object could not be serialized.- See Also:
-
DESERIALIZATION_FAILED_1
public static final int DESERIALIZATION_FAILED_1The error with code90027
is thrown when an object could not be de-serialized.- See Also:
-
IO_EXCEPTION_1
public static final int IO_EXCEPTION_1The error with code90028
is thrown when an input / output error occurred. For more information, see the root cause of the exception.- See Also:
-
NOT_ON_UPDATABLE_ROW
public static final int NOT_ON_UPDATABLE_ROWThe error with code90029
is thrown when calling ResultSet.deleteRow(), insertRow(), or updateRow() when the current row is not updatable. Example:ResultSet rs = stat.executeQuery("SELECT * FROM TEST"); rs.next(); rs.insertRow();
- See Also:
-
FILE_CORRUPTED_1
public static final int FILE_CORRUPTED_1The error with code90030
is thrown when the database engine has detected a checksum mismatch in the data or index. To solve this problem, restore a backup or use the Recovery tool (org.h2.tools.Recover).- See Also:
-
IO_EXCEPTION_2
public static final int IO_EXCEPTION_2The error with code90031
is thrown when an input / output error occurred. For more information, see the root cause of the exception.- See Also:
-
USER_NOT_FOUND_1
public static final int USER_NOT_FOUND_1The error with code90032
is thrown when trying to drop or alter a user that does not exist. Example:DROP USER TEST_USER;
- See Also:
-
USER_ALREADY_EXISTS_1
public static final int USER_ALREADY_EXISTS_1The error with code90033
is thrown when trying to create a user or role if a user with this name already exists. Example:CREATE USER TEST_USER; CREATE USER TEST_USER;
- See Also:
-
TRACE_FILE_ERROR_2
public static final int TRACE_FILE_ERROR_2The error with code90034
is thrown when writing to the trace file failed, for example because the there is an I/O exception. This message is printed to System.out, but only once.- See Also:
-
SEQUENCE_ALREADY_EXISTS_1
public static final int SEQUENCE_ALREADY_EXISTS_1The error with code90035
is thrown when trying to create a sequence if a sequence with this name already exists. Example:CREATE SEQUENCE TEST_SEQ; CREATE SEQUENCE TEST_SEQ;
- See Also:
-
SEQUENCE_NOT_FOUND_1
public static final int SEQUENCE_NOT_FOUND_1The error with code90036
is thrown when trying to access a sequence that does not exist. Example:SELECT NEXT VALUE FOR SEQUENCE XYZ;
- See Also:
-
VIEW_NOT_FOUND_1
public static final int VIEW_NOT_FOUND_1The error with code90037
is thrown when trying to drop or alter a view that does not exist. Example:DROP VIEW XYZ;
- See Also:
-
VIEW_ALREADY_EXISTS_1
public static final int VIEW_ALREADY_EXISTS_1The error with code90038
is thrown when trying to create a view if a view with this name already exists. Example:CREATE VIEW DUMMY AS SELECT * FROM DUAL; CREATE VIEW DUMMY AS SELECT * FROM DUAL;
- See Also:
-
LOB_CLOSED_ON_TIMEOUT_1
public static final int LOB_CLOSED_ON_TIMEOUT_1The error with code90039
is thrown when trying to access a CLOB or BLOB object that timed out. See the database setting LOB_TIMEOUT.- See Also:
-
ADMIN_RIGHTS_REQUIRED
public static final int ADMIN_RIGHTS_REQUIREDThe error with code90040
is thrown when a user that is not administrator tries to execute a statement that requires admin privileges.- See Also:
-
TRIGGER_ALREADY_EXISTS_1
public static final int TRIGGER_ALREADY_EXISTS_1The error with code90041
is thrown when trying to create a trigger and there is already a trigger with that name.CREATE TABLE TEST(ID INT); CREATE TRIGGER TRIGGER_A AFTER INSERT ON TEST CALL "org.h2.samples.TriggerSample$MyTrigger"; CREATE TRIGGER TRIGGER_A AFTER INSERT ON TEST CALL "org.h2.samples.TriggerSample$MyTrigger";
- See Also:
-
TRIGGER_NOT_FOUND_1
public static final int TRIGGER_NOT_FOUND_1The error with code90042
is thrown when trying to drop a trigger that does not exist. Example:DROP TRIGGER TRIGGER_XYZ;
- See Also:
-
ERROR_CREATING_TRIGGER_OBJECT_3
public static final int ERROR_CREATING_TRIGGER_OBJECT_3The error with code90043
is thrown when there is an error initializing the trigger, for example because the class does not implement the Trigger interface. See the root cause for details. Example:CREATE TABLE TEST(ID INT); CREATE TRIGGER TRIGGER_A AFTER INSERT ON TEST CALL "java.lang.String";
- See Also:
-
ERROR_EXECUTING_TRIGGER_3
public static final int ERROR_EXECUTING_TRIGGER_3The error with code90044
is thrown when an exception or error occurred while calling the triggers fire method. See the root cause for details.- See Also:
-
CONSTRAINT_ALREADY_EXISTS_1
public static final int CONSTRAINT_ALREADY_EXISTS_1The error with code90045
is thrown when trying to create a constraint if an object with this name already exists. Example:CREATE TABLE TEST(ID INT NOT NULL); ALTER TABLE TEST ADD CONSTRAINT PK PRIMARY KEY(ID); ALTER TABLE TEST ADD CONSTRAINT PK PRIMARY KEY(ID);
- See Also:
-
URL_FORMAT_ERROR_2
public static final int URL_FORMAT_ERROR_2The error with code90046
is thrown when trying to open a connection to a database using an unsupported URL format. Please see the documentation on the supported URL format and examples. Example:jdbc:h2:;;
- See Also:
-
DRIVER_VERSION_ERROR_2
public static final int DRIVER_VERSION_ERROR_2The error with code90047
is thrown when trying to connect to a TCP server with an incompatible client.- See Also:
-
FILE_VERSION_ERROR_1
public static final int FILE_VERSION_ERROR_1The error with code90048
is thrown when the file header of a database files (*.db) does not match the expected version, or if it is corrupted.- See Also:
-
FILE_ENCRYPTION_ERROR_1
public static final int FILE_ENCRYPTION_ERROR_1The error with code90049
is thrown when trying to open an encrypted database with the wrong file encryption password or algorithm.- See Also:
-
WRONG_PASSWORD_FORMAT
public static final int WRONG_PASSWORD_FORMATThe error with code90050
is thrown when trying to open an encrypted database, but not separating the file password from the user password. The file password is specified in the password field, before the user password. A single space needs to be added between the file password and the user password; the file password itself may not contain spaces. File passwords (as well as user passwords) are case sensitive. Example of wrong usage:String url = "jdbc:h2:˜/test;CIPHER=AES"; String passwords = "filePasswordUserPassword"; DriverManager.getConnection(url, "sa", pwds);
Correct:String url = "jdbc:h2:˜/test;CIPHER=AES"; String passwords = "filePassword userPassword"; DriverManager.getConnection(url, "sa", pwds);
- See Also:
-
SUBQUERY_IS_NOT_SINGLE_COLUMN
public static final int SUBQUERY_IS_NOT_SINGLE_COLUMNThe error with code90052
is thrown when a single-column subquery is expected but a subquery with other number of columns was specified. Example:VALUES ARRAY(SELECT A, B FROM TEST)
- See Also:
-
SCALAR_SUBQUERY_CONTAINS_MORE_THAN_ONE_ROW
public static final int SCALAR_SUBQUERY_CONTAINS_MORE_THAN_ONE_ROWThe error with code90053
is thrown when a subquery that is used as a value contains more than one row. Example:CREATE TABLE TEST(ID INT, NAME VARCHAR); INSERT INTO TEST VALUES(1, 'Hello'), (1, 'World'); SELECT X, (SELECT NAME FROM TEST WHERE ID=X) FROM DUAL;
- See Also:
-
INVALID_USE_OF_AGGREGATE_FUNCTION_1
public static final int INVALID_USE_OF_AGGREGATE_FUNCTION_1The error with code90054
is thrown when an aggregate function is used where it is not allowed. Example:CREATE TABLE TEST(ID INT); INSERT INTO TEST VALUES(1), (2); SELECT MAX(ID) FROM TEST WHERE ID = MAX(ID) GROUP BY ID;
- See Also:
-
UNSUPPORTED_CIPHER
public static final int UNSUPPORTED_CIPHERThe error with code90055
is thrown when trying to open a database with an unsupported cipher algorithm. Supported is AES. Example:jdbc:h2:~/test;CIPHER=DES
- See Also:
-
INVALID_TO_DATE_FORMAT
public static final int INVALID_TO_DATE_FORMATThe error with code90056
is thrown when trying to format a timestamp using TO_DATE and TO_TIMESTAMP with an invalid format.- See Also:
-
CONSTRAINT_NOT_FOUND_1
public static final int CONSTRAINT_NOT_FOUND_1The error with code90057
is thrown when trying to drop a constraint that does not exist. Example:CREATE TABLE TEST(ID INT); ALTER TABLE TEST DROP CONSTRAINT CID;
- See Also:
-
COMMIT_ROLLBACK_NOT_ALLOWED
public static final int COMMIT_ROLLBACK_NOT_ALLOWEDThe error with code90058
is thrown when trying to call commit or rollback inside a trigger, or when trying to call a method inside a trigger that implicitly commits the current transaction, if an object is locked. This is not because it would release the lock too early.- See Also:
-
AMBIGUOUS_COLUMN_NAME_1
public static final int AMBIGUOUS_COLUMN_NAME_1The error with code90059
is thrown when a query contains a column that could belong to multiple tables. Example:CREATE TABLE PARENT(ID INT, NAME VARCHAR); CREATE TABLE CHILD(PID INT, NAME VARCHAR); SELECT ID, NAME FROM PARENT P, CHILD C WHERE P.ID = C.PID;
- See Also:
-
UNSUPPORTED_LOCK_METHOD_1
public static final int UNSUPPORTED_LOCK_METHOD_1The error with code90060
is thrown when trying to use a file locking mechanism that is not supported. Currently only FILE (the default) and SOCKET are supported Example:jdbc:h2:~/test;FILE_LOCK=LDAP
- See Also:
-
EXCEPTION_OPENING_PORT_2
public static final int EXCEPTION_OPENING_PORT_2The error with code90061
is thrown when trying to start a server if a server is already running at the same port. It could also be a firewall problem. To find out if another server is already running, run the following command on Windows:netstat -ano
The column PID is the process id as listed in the Task Manager. For Linux, use:netstat -npl
- See Also:
-
FILE_CREATION_FAILED_1
public static final int FILE_CREATION_FAILED_1The error with code90062
is thrown when a directory or file could not be created. This can occur when trying to create a directory if a file with the same name already exists, or vice versa.- See Also:
-
SAVEPOINT_IS_INVALID_1
public static final int SAVEPOINT_IS_INVALID_1The error with code90063
is thrown when trying to rollback to a savepoint that is not defined. Example:ROLLBACK TO SAVEPOINT S_UNKNOWN;
- See Also:
-
SAVEPOINT_IS_UNNAMED
public static final int SAVEPOINT_IS_UNNAMEDThe error with code90064
is thrown when Savepoint.getSavepointName() is called on an unnamed savepoint. Example:Savepoint sp = conn.setSavepoint(); sp.getSavepointName();
- See Also:
-
SAVEPOINT_IS_NAMED
public static final int SAVEPOINT_IS_NAMEDThe error with code90065
is thrown when Savepoint.getSavepointId() is called on a named savepoint. Example:Savepoint sp = conn.setSavepoint("Joe"); sp.getSavepointId();
- See Also:
-
DUPLICATE_PROPERTY_1
public static final int DUPLICATE_PROPERTY_1The error with code90066
is thrown when the same property appears twice in the database URL or in the connection properties. Example:jdbc:h2:~/test;LOCK_TIMEOUT=0;LOCK_TIMEOUT=1
- See Also:
-
CONNECTION_BROKEN_1
public static final int CONNECTION_BROKEN_1The error with code90067
is thrown when the client could not connect to the database, or if the connection was lost. Possible reasons are: the database server is not running at the given port, the connection was closed due to a shutdown, or the server was stopped. Other possible causes are: the server is not an H2 server, or the network connection is broken.- See Also:
-
ORDER_BY_NOT_IN_RESULT
public static final int ORDER_BY_NOT_IN_RESULTThe error with code90068
is thrown when the given expression that is used in the ORDER BY is not in the result list. This is required for distinct queries, otherwise the result would be ambiguous. Example of wrong usage:CREATE TABLE TEST(ID INT, NAME VARCHAR); INSERT INTO TEST VALUES(2, 'Hello'), (1, 'Hello'); SELECT DISTINCT NAME FROM TEST ORDER BY ID; Order by expression ID must be in the result list in this case
Correct:SELECT DISTINCT ID, NAME FROM TEST ORDER BY ID;
- See Also:
-
ROLE_ALREADY_EXISTS_1
public static final int ROLE_ALREADY_EXISTS_1The error with code90069
is thrown when trying to create a role if an object with this name already exists. Example:CREATE ROLE TEST_ROLE; CREATE ROLE TEST_ROLE;
- See Also:
-
ROLE_NOT_FOUND_1
public static final int ROLE_NOT_FOUND_1The error with code90070
is thrown when trying to drop or grant a role that does not exists. Example:DROP ROLE TEST_ROLE_2;
- See Also:
-
USER_OR_ROLE_NOT_FOUND_1
public static final int USER_OR_ROLE_NOT_FOUND_1The error with code90071
is thrown when trying to grant or revoke if no role or user with that name exists. Example:GRANT SELECT ON TEST TO UNKNOWN;
- See Also:
-
ROLES_AND_RIGHT_CANNOT_BE_MIXED
public static final int ROLES_AND_RIGHT_CANNOT_BE_MIXEDThe error with code90072
is thrown when trying to grant or revoke both roles and rights at the same time. Example:GRANT SELECT, TEST_ROLE ON TEST TO SA;
- See Also:
-
METHODS_MUST_HAVE_DIFFERENT_PARAMETER_COUNTS_2
public static final int METHODS_MUST_HAVE_DIFFERENT_PARAMETER_COUNTS_2The error with code90073
is thrown when trying to create an alias for a Java method, if two methods exists in this class that have this name and the same number of parameters. Example of wrong usage:CREATE ALIAS GET_LONG FOR "java.lang.Long.getLong";
Correct:CREATE ALIAS GET_LONG FOR "java.lang.Long.getLong(java.lang.String, java.lang.Long)";
- See Also:
-
ROLE_ALREADY_GRANTED_1
public static final int ROLE_ALREADY_GRANTED_1The error with code90074
is thrown when trying to grant a role that has already been granted. Example:CREATE ROLE TEST_A; CREATE ROLE TEST_B; GRANT TEST_A TO TEST_B; GRANT TEST_B TO TEST_A;
- See Also:
-
COLUMN_IS_PART_OF_INDEX_1
public static final int COLUMN_IS_PART_OF_INDEX_1The error with code90075
is thrown when trying to alter a table and allow null for a column that is part of a primary key or hash index. Example:CREATE TABLE TEST(ID INT PRIMARY KEY); ALTER TABLE TEST ALTER COLUMN ID NULL;
- See Also:
-
FUNCTION_ALIAS_ALREADY_EXISTS_1
public static final int FUNCTION_ALIAS_ALREADY_EXISTS_1The error with code90076
is thrown when trying to create a function alias for a system function or for a function that is already defined. Example:CREATE ALIAS SQRT FOR "java.lang.Math.sqrt"
- See Also:
-
FUNCTION_ALIAS_NOT_FOUND_1
public static final int FUNCTION_ALIAS_NOT_FOUND_1The error with code90077
is thrown when trying to drop a system function or a function alias that does not exist. Example:DROP ALIAS SQRT;
- See Also:
-
SCHEMA_ALREADY_EXISTS_1
public static final int SCHEMA_ALREADY_EXISTS_1The error with code90078
is thrown when trying to create a schema if an object with this name already exists. Example:CREATE SCHEMA TEST_SCHEMA; CREATE SCHEMA TEST_SCHEMA;
- See Also:
-
SCHEMA_NOT_FOUND_1
public static final int SCHEMA_NOT_FOUND_1The error with code90079
is thrown when trying to drop a schema that does not exist. Example:DROP SCHEMA UNKNOWN;
- See Also:
-
SCHEMA_NAME_MUST_MATCH
public static final int SCHEMA_NAME_MUST_MATCHThe error with code90080
is thrown when trying to rename a object to a different schema, or when trying to create a related object in another schema. For CREATE LINKED TABLE, it is thrown when multiple tables with that name exist in different schemas. Example:CREATE SCHEMA TEST_SCHEMA; CREATE TABLE TEST(ID INT); CREATE INDEX TEST_ID ON TEST(ID); ALTER INDEX TEST_ID RENAME TO TEST_SCHEMA.IDX_TEST_ID;
- See Also:
-
COLUMN_CONTAINS_NULL_VALUES_1
public static final int COLUMN_CONTAINS_NULL_VALUES_1The error with code90081
is thrown when trying to alter a column to not allow NULL, if there is already data in the table where this column is NULL. Example:CREATE TABLE TEST(ID INT); INSERT INTO TEST VALUES(NULL); ALTER TABLE TEST ALTER COLUMN ID VARCHAR NOT NULL;
- See Also:
-
SEQUENCE_BELONGS_TO_A_TABLE_1
public static final int SEQUENCE_BELONGS_TO_A_TABLE_1The error with code90082
is thrown when trying to drop a system generated sequence.- See Also:
-
COLUMN_IS_REFERENCED_1
public static final int COLUMN_IS_REFERENCED_1The error with code90083
is thrown when trying to drop a column that is part of a constraint. Example:CREATE TABLE TEST(ID INT, PID INT REFERENCES(ID)); ALTER TABLE TEST DROP COLUMN PID;
- See Also:
-
CANNOT_DROP_LAST_COLUMN
public static final int CANNOT_DROP_LAST_COLUMNThe error with code90084
is thrown when trying to drop the last column of a table. Example:CREATE TABLE TEST(ID INT); ALTER TABLE TEST DROP COLUMN ID;
- See Also:
-
INDEX_BELONGS_TO_CONSTRAINT_2
public static final int INDEX_BELONGS_TO_CONSTRAINT_2The error with code90085
is thrown when trying to manually drop an index that was generated by the system because of a unique or referential constraint. To find the owner of the index without attempt to drop it runSELECT CONSTRAINT_SCHEMA, CONSTRAINT_NAME FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE INDEX_SCHEMA = '<index schema>' AND INDEX_NAME = '<index name>' FETCH FIRST ROW ONLY
Example of wrong usage:CREATE TABLE TEST(ID INT, CONSTRAINT UID UNIQUE(ID)); DROP INDEX UID_INDEX_0; Index UID_INDEX_0 belongs to constraint UID
Correct:ALTER TABLE TEST DROP CONSTRAINT UID;
- See Also:
-
CLASS_NOT_FOUND_1
public static final int CLASS_NOT_FOUND_1The error with code90086
is thrown when a class can not be loaded because it is not in the classpath or because a related class is not in the classpath. Example:CREATE ALIAS TEST FOR "java.lang.invalid.Math.sqrt";
- See Also:
-
METHOD_NOT_FOUND_1
public static final int METHOD_NOT_FOUND_1The error with code90087
is thrown when a method with matching number of arguments was not found in the class. Example:CREATE ALIAS TO_BINARY FOR "java.lang.Long.toBinaryString(long)"; CALL TO_BINARY(10, 2);
- See Also:
-
UNKNOWN_MODE_1
public static final int UNKNOWN_MODE_1The error with code90088
is thrown when trying to switch to an unknown mode. Example:SET MODE UNKNOWN;
- See Also:
-
COLLATION_CHANGE_WITH_DATA_TABLE_1
public static final int COLLATION_CHANGE_WITH_DATA_TABLE_1The error with code90089
is thrown when trying to change the collation while there was already data in the database. The collation of the database must be set when the database is empty. Example of wrong usage:CREATE TABLE TEST(NAME VARCHAR PRIMARY KEY); INSERT INTO TEST VALUES('Hello', 'World'); SET COLLATION DE; Collation cannot be changed because there is a data table: PUBLIC.TEST
Correct:SET COLLATION DE; CREATE TABLE TEST(NAME VARCHAR PRIMARY KEY); INSERT INTO TEST VALUES('Hello', 'World');
- See Also:
-
SCHEMA_CAN_NOT_BE_DROPPED_1
public static final int SCHEMA_CAN_NOT_BE_DROPPED_1The error with code90090
is thrown when trying to drop a schema that may not be dropped (the schema PUBLIC and the schema INFORMATION_SCHEMA). Example:DROP SCHEMA PUBLIC;
- See Also:
-
ROLE_CAN_NOT_BE_DROPPED_1
public static final int ROLE_CAN_NOT_BE_DROPPED_1The error with code90091
is thrown when trying to drop the role PUBLIC. Example:DROP ROLE PUBLIC;
- See Also:
-
CLUSTER_ERROR_DATABASE_RUNS_ALONE
public static final int CLUSTER_ERROR_DATABASE_RUNS_ALONEThe error with code90093
is thrown when trying to connect to a clustered database that runs in standalone mode. This can happen if clustering is not enabled on the database, or if one of the clients disabled clustering because it can not see the other cluster node.- See Also:
-
CLUSTER_ERROR_DATABASE_RUNS_CLUSTERED_1
public static final int CLUSTER_ERROR_DATABASE_RUNS_CLUSTERED_1The error with code90094
is thrown when trying to connect to a clustered database that runs together with a different cluster node setting than what is used when trying to connect.- See Also:
-
STRING_FORMAT_ERROR_1
public static final int STRING_FORMAT_ERROR_1The error with code90095
is thrown when calling the method STRINGDECODE with an invalid escape sequence. Only Java style escape sequences and Java properties file escape sequences are supported. Example:CALL STRINGDECODE('\i');
- See Also:
-
NOT_ENOUGH_RIGHTS_FOR_1
public static final int NOT_ENOUGH_RIGHTS_FOR_1The error with code90096
is thrown when trying to perform an operation with a non-admin user if the user does not have enough rights.- See Also:
-
DATABASE_IS_READ_ONLY
public static final int DATABASE_IS_READ_ONLYThe error with code90097
is thrown when trying to delete or update a database if it is open in read-only mode. Example:jdbc:h2:~/test;ACCESS_MODE_DATA=R CREATE TABLE TEST(ID INT);
- See Also:
-
DATABASE_IS_CLOSED
public static final int DATABASE_IS_CLOSEDThe error with code90098
is thrown when the database has been closed, for example because the system ran out of memory or because the self-destruction counter has reached zero. This counter is only used for recovery testing, and not set in normal operation.- See Also:
-
ERROR_SETTING_DATABASE_EVENT_LISTENER_2
public static final int ERROR_SETTING_DATABASE_EVENT_LISTENER_2The error with code90099
is thrown when an error occurred trying to initialize the database event listener. Example:jdbc:h2:˜/test;DATABASE_EVENT_LISTENER='java.lang.String'
- See Also:
-
WRONG_XID_FORMAT_1
public static final int WRONG_XID_FORMAT_1The error with code90101
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.- See Also:
-
UNSUPPORTED_COMPRESSION_OPTIONS_1
public static final int UNSUPPORTED_COMPRESSION_OPTIONS_1The error with code90102
is thrown when trying to use unsupported options for the given compression algorithm. Example of wrong usage:CALL COMPRESS(STRINGTOUTF8(SPACE(100)), 'DEFLATE l 10');
Correct:CALL COMPRESS(STRINGTOUTF8(SPACE(100)), 'DEFLATE l 9');
- See Also:
-
UNSUPPORTED_COMPRESSION_ALGORITHM_1
public static final int UNSUPPORTED_COMPRESSION_ALGORITHM_1The error with code90103
is thrown when trying to use an unsupported compression algorithm. Example:CALL COMPRESS(STRINGTOUTF8(SPACE(100)), 'BZIP');
- See Also:
-
COMPRESSION_ERROR
public static final int COMPRESSION_ERRORThe error with code90104
is thrown when the data can not be de-compressed. Example:CALL EXPAND(X'00FF');
- See Also:
-
EXCEPTION_IN_FUNCTION_1
public static final int EXCEPTION_IN_FUNCTION_1The error with code90105
is thrown when an exception occurred in a user-defined method. Example:CREATE ALIAS SYS_PROP FOR "java.lang.System.getProperty"; CALL SYS_PROP(NULL);
- See Also:
-
CANNOT_TRUNCATE_1
public static final int CANNOT_TRUNCATE_1The error with code90106
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:TRUNCATE TABLE INFORMATION_SCHEMA.SETTINGS;
- See Also:
-
CANNOT_DROP_2
public static final int CANNOT_DROP_2The error with code90107
is thrown when trying to drop an object because another object would become invalid. Example:CREATE TABLE COUNT(X INT); CREATE TABLE ITEMS(ID INT DEFAULT SELECT MAX(X)+1 FROM COUNT); DROP TABLE COUNT;
- See Also:
-
OUT_OF_MEMORY
public static final int OUT_OF_MEMORYThe error with code90108
is thrown when not enough heap memory was available. A possible solutions is to increase the memory size usingjava -Xmx128m ...
. Another solution is to reduce the cache size.- See Also:
-
VIEW_IS_INVALID_2
public static final int VIEW_IS_INVALID_2The error with code90109
is thrown when trying to run a query against an invalid view. Example:CREATE FORCE VIEW TEST_VIEW AS SELECT * FROM TEST; SELECT * FROM TEST_VIEW;
- See Also:
-
TYPES_ARE_NOT_COMPARABLE_2
public static final int TYPES_ARE_NOT_COMPARABLE_2The error with code90110
is thrown when trying to compare or combine values of incomparable data types. Example:CREATE TABLE test (id INT NOT NULL, name VARCHAR); select * from test where id = (1, 2);
- See Also:
-
ERROR_ACCESSING_LINKED_TABLE_2
public static final int ERROR_ACCESSING_LINKED_TABLE_2The error with code90111
is thrown when an exception occurred while accessing a linked table.- See Also:
-
ROW_NOT_FOUND_WHEN_DELETING_1
public static final int ROW_NOT_FOUND_WHEN_DELETING_1The error with code90112
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.Row not found when trying to delete from index UID_INDEX_0
- See Also:
-
UNSUPPORTED_SETTING_1
public static final int UNSUPPORTED_SETTING_1The error with code90113
is thrown when the database URL contains unsupported settings. Example:jdbc:h2:~/test;UNKNOWN=TRUE
- See Also:
-
CONSTANT_ALREADY_EXISTS_1
public static final int CONSTANT_ALREADY_EXISTS_1The error with code90114
is thrown when trying to create a constant if a constant with this name already exists. Example:CREATE CONSTANT TEST VALUE 1; CREATE CONSTANT TEST VALUE 1;
- See Also:
-
CONSTANT_NOT_FOUND_1
public static final int CONSTANT_NOT_FOUND_1The error with code90115
is thrown when trying to drop a constant that does not exists. Example:DROP CONSTANT UNKNOWN;
- See Also:
-
LITERALS_ARE_NOT_ALLOWED
public static final int LITERALS_ARE_NOT_ALLOWEDThe error with code90116
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:SET ALLOW_LITERALS NONE; CALL 1+1;
- See Also:
-
REMOTE_CONNECTION_NOT_ALLOWED
public static final int REMOTE_CONNECTION_NOT_ALLOWEDThe error with code90117
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 as in:java org.h2.tools.Server -tcp -tcpAllowOthers
Or, when starting the server from an application, use:Server server = Server.createTcpServer("-tcpAllowOthers"); server.start();
- See Also:
-
CANNOT_DROP_TABLE_1
public static final int CANNOT_DROP_TABLE_1The error with code90118
is thrown when trying to drop a table can not be dropped. Example:DROP TABLE INFORMATION_SCHEMA.SETTINGS;
- See Also:
-
DOMAIN_ALREADY_EXISTS_1
public static final int DOMAIN_ALREADY_EXISTS_1The error with code90119
is thrown when trying to create a domain if an object with this name already exists, or when trying to overload a built-in data type. Example:CREATE DOMAIN INTEGER AS VARCHAR; CREATE DOMAIN EMAIL AS VARCHAR CHECK LOCATE('@', VALUE) > 0; CREATE DOMAIN EMAIL AS VARCHAR CHECK LOCATE('@', VALUE) > 0;
- See Also:
-
USER_DATA_TYPE_ALREADY_EXISTS_1
Deprecated.Deprecated since 1.4.198. UseDOMAIN_ALREADY_EXISTS_1
instead.- See Also:
-
DOMAIN_NOT_FOUND_1
public static final int DOMAIN_NOT_FOUND_1The error with code90120
is thrown when trying to drop a domain that doesn't exist. Example:DROP DOMAIN UNKNOWN;
- See Also:
-
USER_DATA_TYPE_NOT_FOUND_1
Deprecated.Deprecated since 1.4.198. UseDOMAIN_NOT_FOUND_1
instead.- See Also:
-
DATABASE_CALLED_AT_SHUTDOWN
public static final int DATABASE_CALLED_AT_SHUTDOWNThe error with code90121
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.- See Also:
-
WITH_TIES_WITHOUT_ORDER_BY
public static final int WITH_TIES_WITHOUT_ORDER_BYThe error with code90122
is thrown when WITH TIES clause is used without ORDER BY clause.- See Also:
-
CANNOT_MIX_INDEXED_AND_UNINDEXED_PARAMS
public static final int CANNOT_MIX_INDEXED_AND_UNINDEXED_PARAMSThe error with code90123
is thrown when trying mix regular parameters and indexed parameters in the same statement. Example:SELECT ?, ?1 FROM DUAL;
- See Also:
-
FILE_NOT_FOUND_1
public static final int FILE_NOT_FOUND_1The error with code90124
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.- See Also:
-
INVALID_CLASS_2
public static final int INVALID_CLASS_2The error with code90125
is thrown when PreparedStatement.setBigDecimal is called with object that extends the class BigDecimal. Using extensions of BigDecimal is dangerous because the database relies on the behavior of BigDecimal. Example of wrong usage:BigDecimal bd = new MyDecimal("$10.3"); prep.setBigDecimal(1, bd); Invalid class, expected java.math.BigDecimal but got MyDecimal
Correct:BigDecimal bd = new BigDecimal("10.3"); prep.setBigDecimal(1, bd);
- See Also:
-
DATABASE_IS_NOT_PERSISTENT
public static final int DATABASE_IS_NOT_PERSISTENTThe error with code90126
is thrown when trying to call the BACKUP statement for an in-memory database. Example:jdbc:h2:mem: BACKUP TO 'test.zip';
- See Also:
-
RESULT_SET_NOT_UPDATABLE
public static final int RESULT_SET_NOT_UPDATABLEThe error with code90127
is thrown when trying to update or delete a row in a result set if the result set is not updatable. Result sets are only updatable if: the statement was created with updatable concurrency; all columns of the result set are from the same table; the table is a data table (not a system table or view); all columns of the primary key or any unique index are included; all columns of the result set are columns of that table.- See Also:
-
RESULT_SET_NOT_SCROLLABLE
public static final int RESULT_SET_NOT_SCROLLABLEThe error with code90128
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:rs.first();
- See Also:
-
TRANSACTION_NOT_FOUND_1
public static final int TRANSACTION_NOT_FOUND_1The error with code90129
is thrown when trying to commit a transaction that doesn't exist. Example:PREPARE COMMIT ABC; COMMIT TRANSACTION TEST;
- See Also:
-
METHOD_NOT_ALLOWED_FOR_PREPARED_STATEMENT
public static final int METHOD_NOT_ALLOWED_FOR_PREPARED_STATEMENTThe error with code90130
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 of wrong usage:PreparedStatement prep = conn.prepareStatement("SELECT * FROM TEST"); prep.execute("DELETE FROM TEST");
Correct:Statement stat = conn.createStatement(); stat.execute("DELETE FROM TEST");
- See Also:
-
CONCURRENT_UPDATE_1
public static final int CONCURRENT_UPDATE_1The error with code90131
is thrown when using multi version concurrency control, and trying to update the same row from within two connections at the same time, or trying to insert two rows with the same key from two connections. Example:jdbc:h2:~/test 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;
- See Also:
-
AGGREGATE_NOT_FOUND_1
public static final int AGGREGATE_NOT_FOUND_1The error with code90132
is thrown when trying to drop a user-defined aggregate function that doesn't exist. Example:DROP AGGREGATE UNKNOWN;
- See Also:
-
CANNOT_CHANGE_SETTING_WHEN_OPEN_1
public static final int CANNOT_CHANGE_SETTING_WHEN_OPEN_1The error with code90133
is thrown when trying to change a specific database property while the database is already open.- See Also:
-
ACCESS_DENIED_TO_CLASS_1
public static final int ACCESS_DENIED_TO_CLASS_1The error with code90134
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.- See Also:
-
DATABASE_IS_IN_EXCLUSIVE_MODE
public static final int DATABASE_IS_IN_EXCLUSIVE_MODEThe error with code90135
is thrown when trying to open a connection to a database that is currently open in exclusive mode. The exclusive mode is set using:SET EXCLUSIVE TRUE;
- See Also:
-
WINDOW_NOT_FOUND_1
public static final int WINDOW_NOT_FOUND_1The error with code90136
is thrown when trying to reference a window that does not exist. Example:SELECT LEAD(X) OVER W FROM TEST;
- See Also:
-
CAN_ONLY_ASSIGN_TO_VARIABLE_1
public static final int CAN_ONLY_ASSIGN_TO_VARIABLE_1The error with code90137
is thrown when trying to assign a value to something that is not a variable.SELECT AMOUNT, SET(@V, COALESCE(@V, 0)+AMOUNT) FROM TEST;
- See Also:
-
INVALID_DATABASE_NAME_1
public static final int INVALID_DATABASE_NAME_1The error with code90138
is thrown when trying to open a persistent database using an incorrect database name. The name of a persistent database contains the path and file name prefix where the data is stored. The file name part of a database name must be at least two characters. Example of wrong usage:DriverManager.getConnection("jdbc:h2:~/t"); DriverManager.getConnection("jdbc:h2:~/test/");
Correct:DriverManager.getConnection("jdbc:h2:~/te"); DriverManager.getConnection("jdbc:h2:~/test/te");
- See Also:
-
PUBLIC_STATIC_JAVA_METHOD_NOT_FOUND_1
public static final int PUBLIC_STATIC_JAVA_METHOD_NOT_FOUND_1The error with code90139
is thrown when the specified public static Java method was not found in the class. Example:CREATE ALIAS TEST FOR "java.lang.Math.test";
- See Also:
-
RESULT_SET_READONLY
public static final int RESULT_SET_READONLYThe error with code90140
is thrown when trying to update or delete a row in a result set if the statement was not created with updatable concurrency. Result sets are only updatable if the statement was created with updatable concurrency, and if the result set contains all columns of the primary key or of a unique index of a table.- See Also:
-
JAVA_OBJECT_SERIALIZER_CHANGE_WITH_DATA_TABLE
public static final int JAVA_OBJECT_SERIALIZER_CHANGE_WITH_DATA_TABLEThe error with code90141
is thrown when trying to change the java object serializer while there was already data in the database. The serializer of the database must be set when the database is empty.- See Also:
-
STEP_SIZE_MUST_NOT_BE_ZERO
public static final int STEP_SIZE_MUST_NOT_BE_ZEROThe error with code90142
is thrown when trying to set zero for step size.- See Also:
-
ROW_NOT_FOUND_IN_PRIMARY_INDEX
public static final int ROW_NOT_FOUND_IN_PRIMARY_INDEXThe error with code90143
is thrown when trying to fetch a row from the primary index and the row is not there.- See Also:
-
AUTHENTICATOR_NOT_AVAILABLE
public static final int AUTHENTICATOR_NOT_AVAILABLEThe error with code90144
is thrown when user trying to login into a database with AUTHREALM set and the target database doesn't have an authenticator definedAuthenticator experimental feature can be enabled by
SET AUTHENTICATOR TRUE
- See Also:
-
FOR_UPDATE_IS_NOT_ALLOWED_IN_DISTINCT_OR_GROUPED_SELECT
public static final int FOR_UPDATE_IS_NOT_ALLOWED_IN_DISTINCT_OR_GROUPED_SELECTThe error with code90145
is thrown when trying to execute a SELECT statement with non-window aggregates, DISTINCT, GROUP BY, or HAVING clauses together with FOR UPDATE clause.SELECT DISTINCT NAME FOR UPDATE; SELECT MAX(VALUE) FOR UPDATE;
- See Also:
-
DATABASE_NOT_FOUND_WITH_IF_EXISTS_1
public static final int DATABASE_NOT_FOUND_WITH_IF_EXISTS_1The error with code90146
is thrown when trying to open a database that does not exist using the flag IFEXISTS=TRUEjdbc:h2:./database_that_does_not_exist
- See Also:
-
METHOD_DISABLED_ON_AUTOCOMMIT_TRUE
public static final int METHOD_DISABLED_ON_AUTOCOMMIT_TRUEThe error with code90147
is thrown when trying to execute a statement which closes the transaction (such as commit and rollback) and autocommit mode is on. -
CURRENT_SEQUENCE_VALUE_IS_NOT_DEFINED_IN_SESSION_1
public static final int CURRENT_SEQUENCE_VALUE_IS_NOT_DEFINED_IN_SESSION_1The error with code90148
is thrown when trying to access the current value of a sequence before execution of NEXT VALUE FOR sequenceName in the current session. Example:SELECT CURRENT VALUE FOR SEQUENCE XYZ;
- See Also:
-
REMOTE_DATABASE_NOT_FOUND_1
public static final int REMOTE_DATABASE_NOT_FOUND_1The error with code90149
is thrown when trying to open a database that does not exist remotely without enabling remote database creation first.jdbc:h2:./database_that_does_not_exist
- See Also:
-
INVALID_VALUE_PRECISION
public static final int INVALID_VALUE_PRECISIONThe error with code90150
is thrown when trying to use an invalid precision. Example:CREATE TABLE TABLE1 ( FAIL INTERVAL YEAR(20) );
- See Also:
-
INVALID_VALUE_SCALE
public static final int INVALID_VALUE_SCALEThe error with code90151
is thrown when trying to use an invalid scale or fractional seconds precision. Example:CREATE TABLE TABLE1 ( FAIL TIME(10) );
- See Also:
-
CONSTRAINT_IS_USED_BY_CONSTRAINT_2
public static final int CONSTRAINT_IS_USED_BY_CONSTRAINT_2The error with code90152
is thrown when trying to manually drop a unique or primary key constraint that is referenced by a foreign key constraint without a CASCADE clause.CREATE TABLE PARENT(ID INT CONSTRAINT P1 PRIMARY KEY); CREATE TABLE CHILD(ID INT CONSTRAINT P2 PRIMARY KEY, CHILD INT CONSTRAINT C REFERENCES PARENT); ALTER TABLE PARENT DROP CONSTRAINT P1 RESTRICT;
- See Also:
-
UNCOMPARABLE_REFERENCED_COLUMN_2
public static final int UNCOMPARABLE_REFERENCED_COLUMN_2The error with code90153
is thrown when trying to reference a column of another data type when data types aren't comparable or don't have a session-independent compare order between each other.CREATE TABLE PARENT(T TIMESTAMP UNIQUE); CREATE TABLE CHILD(T TIMESTAMP WITH TIME ZONE REFERENCES PARENT(T));
- See Also:
-
GENERATED_COLUMN_CANNOT_BE_ASSIGNED_1
public static final int GENERATED_COLUMN_CANNOT_BE_ASSIGNED_1The error with code90154
is thrown when trying to assign a value to a generated column.CREATE TABLE TEST(A INT, B INT GENERATED ALWAYS AS (A + 1)); INSERT INTO TEST(A, B) VALUES (1, 1);
- See Also:
-
GENERATED_COLUMN_CANNOT_BE_UPDATABLE_BY_CONSTRAINT_2
public static final int GENERATED_COLUMN_CANNOT_BE_UPDATABLE_BY_CONSTRAINT_2The error with code90155
is thrown when trying to create a referential constraint that can update a referenced generated column.CREATE TABLE PARENT(ID INT PRIMARY KEY, K INT GENERATED ALWAYS AS (ID) UNIQUE); CREATE TABLE CHILD(ID INT PRIMARY KEY, P INT); ALTER TABLE CHILD ADD FOREIGN KEY(P) REFERENCES PARENT(K) ON DELETE SET NULL;
- See Also:
-
COLUMN_ALIAS_IS_NOT_SPECIFIED_1
public static final int COLUMN_ALIAS_IS_NOT_SPECIFIED_1The error with code90156
is thrown when trying to create a view or a table from a select and some expression doesn't have a column name or alias when it is required by a compatibility mode.SET MODE DB2; CREATE TABLE T1(A INT, B INT); CREATE TABLE T2 AS (SELECT A + B FROM T1) WITH DATA;
- See Also:
-
GROUP_BY_NOT_IN_THE_RESULT
public static final int GROUP_BY_NOT_IN_THE_RESULTThe error with code90157
is thrown when the integer index that is used in the GROUP BY is not in the SELECT list- See Also:
-
-
Method Details
-
isCommon
public static boolean isCommon(int errorCode) INTERNAL- Parameters:
errorCode
- to check- Returns:
- true if provided code is common, false otherwise
-
getState
INTERNAL- Parameters:
errorCode
- to get state for- Returns:
- error state
-