Create autoincrement key in Java DB using NetBeans IDE

This may help you:

CREATE TABLE "custinf"

(    
   "CUST_ID" INT not null primary key
        GENERATED ALWAYS AS IDENTITY
        (START WITH 1, INCREMENT BY 1),   
   "FNAME" VARCHAR(50),     
   "LNAME" VARCHAR(50),
   "ADDR" VARCHAR(100),
   "SUBURB" VARCHAR(20),
   "PCODE" INTEGER,  
   "PHONE" INTEGER,
   "MOB" INTEGER,    
   "EMAIL" VARCHAR(100),
   "COMM" VARCHAR(450)    
);

That’s how i got mine to work… to ages to get the frigging thing to actually understand me but that’s the nature of code 😀

BTW!- There is a way to do it in the ide interface
goto the services window,
expand your connection,
expand your projects name,
expand tables,
right click indexes and select add index… the rest of the process speaks for itself really…

Leave a Comment