Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8560315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:14:55+00:00 2026-06-11T16:14:55+00:00

Is it possible to join two ResultSets like join two tables in Java-oracle programming?

  • 0

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!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T16:14:56+00:00Added an answer on June 11, 2026 at 4:14 pm

    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:

    while (ret1.next()) { 
      get id from ret1, 
      query  info from another database;
      bla,bla,...
    }
    ....
    

    The performance is much better than getting two resultsets then looping one inside another…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to check, is it possible to left join two tables using
Is is possible to programatically join two tables using Django's ORM? I have two
Possible Duplicate: how to join 2 tables I am very new to databases. I
I'm using RealURL on a site where I would like to join two tables
Is it possible to join two tables based on the same date, not factoring
Is it possible to JOIN rows from two separate postgres databases? I am working
I would like to be able to join two models by a column which
I'm porting a process which creates a MASSIVE CROSS JOIN of two tables. The
Is it possible to join two tables permanently? Where I am just going to
Possible Duplicate: How to join two tables table 1 Date StartingAum 07/01/2010 120 08/01/2010

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.