How to auto increment database column in Java derby?
问题 Here's the SQL I've tried so far to create the table CREATE TABLE tblPosts (nId INTEGER PRIMARY KEY GENERATED ALWAYS AS IDENTITY, strContent VARCHAR(140) NOT NULL, strLink VARCHAR(200), strImage VARCHAR(200)); using String sql = "INSERT INTO tblPosts VALUES ('" + textFieldContent.getText() + "', '" + textFieldLink.getText() + "', '" + textFieldImage.getText() + "')"; I get an error telling me I'm not providing the nId column value which I'm not but if the column auto-increments I'm not