I have a table that has 3 columns: ID, Name, LastVisit, wich are int, string, timestamp. I'm inserting data in this table and I need to retrieve the ID I just inserted. Problem is that the ID is a sequence. What I am trying to do is:
var insertCmd = connection.prepareStatement('insert into "Test"."TestTable"("ID", "Name", "LastVisit") values(seq.NEXTVAL,?,?)');
var test = insertCmd.execute();
var rowId = test.getString(1);
But I cannot get the rowId like I need to. Is there a way I can retrieve it? Thanks in advance!!