If you want to create a table with an auto increment id column in JavaDB (Derby), the following SQL will do the trick for you applying some rules.

Source Code

The bold part is defining the column called 'ID' to be automatically generated and incremented by 1 every time a new record is written to the table.

1
2
3
4
5
6
CREATE TABLE "aTable"(
   "ID" INT not null primary key
        GENERATED ALWAYS AS IDENTITY
        (START WITH 1, INCREMENT BY 1),
   "Column_Name" VARCHAR(50)
);