简体   繁体   中英

creating a trigger with derby database and netbeans ide

I am developing a simple desktop application using derby database and netbeans IDE I have a table with an ID column with fields that are unique.

first i do not want to manually insert into the ID column secondly looks like the derby DB does not have an auto increment system like with mySQL.

To work around this problem I will like to use a BEFORE TRIGGER to insert into the table when an insert operation is performed.

Does any one have any idea on how to create a trigger for the derby database on the netbeans IDE. Or is it possible to have an auto increment system that will increment the IDE field for me.

best regards

Derby does have an auto increment data type: it's called GENERATED AS IDENTITY.

Read more about it here: http://db.apache.org/derby/docs/10.9/ref/rrefsqlj37836.html#rrefsqlj37836

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM