I've made this design similar to my problem, it's not exact but it close enough to understand my problem:
Some cellular client frequently send their GPS position and the WLAN name that they have in range, sometimes only their position.
I've auto-generated timestamp and auto-incremental idModelGPS from ModelGPS table and I'm using javaDB to write to the DB.
I want to link the ModelGPS to an WLAN name where it happens, but I can't do it because the idModelGPS is autogenerated. I cannot access it to write in the ModelGPS_WLAN table.
I don't know how to handle this, maybe there is a design error or maybe there is a way to solve this problem that I'm unaware of. I'll be glad to hear your opinions.