Error Codes

❗️

This is a legacy Apache Ignite documentation

The new documentation is hosted here: https://ignite.apache.org/docs/latest/

Ignite JDBC drivers enclose error codes into the java.sql.SQLException class that facilitate exception handling on the application side. To get an error code, use the java.sql.SQLException.getSQLState() method that returns a string holding the ANSI SQL error code defined:

// Register JDBC driver.
Class.forName("org.apache.ignite.IgniteJdbcThinDriver");
 
// Open JDBC connection.
Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1");

PreparedStatement ps;

try {
  ps = conn.prepareStatement("INSERT INTO Person(id, name, age) values (1," +
                             "'John', 'unparseableString')");
}
catch (SQLException e) {
    switch (e.getSQLState()) {
      case "0700B":
        System.out.println("Conversion failure");
        break;
        
      case "42000":
        System.out.println("Parsing error");
        break;
        
      default:
        System.out.println("Unprocessed error: " + e.getSQLState());
        break;
    }
}

The table below lists all the error codes supported by Ignite presently. Note that the list may be extended in the future.

CodeDescription
0700BConversion failure (for example, a string expression can't be parsed as a number or date).
0700EInvalid transaction isolation level.
08001The driver failed to open a connection to the cluster.
08003The connection is in the closed state. Happened unexpectedly.
08004The connection is rejected by the cluster.
08006I/O error during communication.
22004Null value not allowed.
22023 Unsupported parameter type.
23000Data integrity constraint violation.
24000Invalid result set state.
0A000Requested operation is not supported.
40001Concurrent update conflict. See Concurrent Updates.
42000Query parsing exception.
50000Ignite internal error.

The code is not defined by ANSI and refers to Ignite specific error. Refer to the java.sql.SQLException error message for more details.