It appears like Firebird doesn't support getGeneratedKeys() once you perform an place by having an auto_increment column. So I must know how I'm able to get hold of the produced key after an place.
1) Must i use "place into customers(...) values(...) coming back id" and refer to this as via a CallableStatement to be able to obtain the produced ID? Exactly how? Should i wrap my place around a "call "
2) Can there be another way to get the produced id under Firebird, some type of "choose last_id_produced()". "choose max(id) from customers" doesn't count.
3) Could it be really correct that getGeneratedKeys() isn't based on Firebird JDBC driver? (optional)
It works out that all you want do is call the "place ... coming back" with executeQuery (from PreparedStatement) rather than executeUpdate. Which will return your ResultSet from where one can obtain the produced id. Never imagined you could call an Place with executeQuery. I figured you needed to do executeUpdate.
this can obtain the current generation
SELECT GEN_ID(GEN_NAME,0) FROM RDB$DATABASE
with GEN_Title being that which you known as that generation
whenever you produce a auto increment area a trigger along with a generation is produced the trigger appears like this usually
SET TERM ^^ ; CREATE TRIGGER TABLE_BEFOREINSERT FOR TABLE ACTIVE BEFORE INSERT POSITION 0 AS BEGIN if ( new.ID is null ) then new.ID = gen_id(GEN_TABLE, 1); END ^^ SET TERM ; ^^
and also the creation for that generation appears like this
CREATE GENERATOR GEN_TABLE; SET GENERATOR GEN_TABLE TO 32;
both of these together make is to ensure that BEFORE a brand new row is placed, it inspections to ascertain if you specified the need for ID, otherwise zinc heightens the generation by one and will get its current value and puts it as being the ID column