I have a method with this code in which I try to get the maximum id value:
try (Connection connection = DriverManager.getConnection(dbUrl)) { try (Statement statement = connection.createStatement()) { ResultSet resultSet = statement.executeQuery("SELECT last_insert_rowid();"); if (resultSet.next()) { return resultSet.getInt(COLUMN_ID); } else { return -1; } } } catch (SQLException e) { throw new ImageReadingException(e); } However, it’s such an error:
Caused by: java.sql.SQLException: no such column: 'id' at org.sqlite.jdbc3.JDBC3ResultSet.findColumn(JDBC3ResultSet.java:48) at org.sqlite.jdbc3.JDBC3ResultSet.getInt(JDBC3ResultSet.java:395) at com.dugin.rostislav.database.sqlite.SQLiteDB.getLastInsertId(SQLiteDB.java:124) ... 40 more However, there is definitely a column (screenshot from SQLite Studio), and even with direct sampling - a similar answer!
What is the error and how to fix it?

resultSet.getInt(COLUMN_ID)- MaxUSELECT last_insert_rowid() as IDthen it will be called that - Mike