If I understood you properly you want to insert a record in one table T1, get PK of the inserted record and use is as a FK in another table T2. In this case Oracle returning clause is very useful, you can use it like this (I'm sorry I don't know hot to use it in Java, but you should get the idea):
declare
fId int;
begin
insert into T1(id) values seq1.nextval returning id into fId
end;
After the insert you'll have the created record id in the fId
variable.