Is it possible to join two ResultSets like join two tables in Java-oracle programming? I am writing a java program which querys two different oracle databases(the databases are physically in different locations). In the program, sql1 returns ResultSet ret1;sql2 returns ResultSet ret2. Suppose ret1 has the following data:
Id item
------------
1 item1
2 item 2
3 item 3
.........
Ret2 has the following data
Id info
---------
1 info1
2 info2
…
I need result like this
Id item info
----------------------
1 item1 info1
2 item2 info2
Can I do something like this in java:
Select ret1.id,ret1.item,ret2,info from ret1, ret2 where ret1.id=ret2.id
I know I can loop from ret1 and get the id then get info from ret2; I am wondering if there is a fast way like join two tables to join two ResultSets without looping? Actually these two results both have half million rows. Thank you!
dblink is not allowed to create due to permission issue. I finally find another solution. Here is what I am doing: I get resultset ret1 then using:
The performance is much better than getting two resultsets then looping one inside another…