Is there something in java similar to SQL join?

For the experienced:

I use java to process some data with approximately 25,000 lines, for example a text data file such as:
Field1:Field2:Old_ID:Field4:Field5:Field6: ...
Now the ID in the Old_ID field is old, and we are in the period of transition which need to have all the IDS of old converted in the new code. Each line is a user and each user has a identifier unique. A conversion table is provided for conversion, and it contains only two fields:
Old_ID:New_ID
What I do now is to put all the lines of the conversion table in a card. The Old_ID is the key and the New_ID matches the value. A loop in the text file, for each value of Old_ID, I get help from New_ID
conversionMap.get(Old_ID)
Who does the work OK. But it seems to me not very elegant. Assume that the table of conversion has 40,000 lines. For 25,000 lines of the data file, the code looks through the lines 40 000 25 000 times. I think it's the SQL command, which would be
Select d.Fiels1, d.Field2, c.New_ID, d.Field4, d.Field5, d.Field6
from data_file d, conversion_table c
where d.Old_ID = c.Old_ID
which I think would not go through the 40 000 25 000 times lines under the hood.

Is there such a ready tool in the java API? Or is he left the developers themselves?

Thank you!



Newman

If you use a hash table, then you don't get all the keys 40,000 each time, only as many who have corresponding to codes. If the ID themselves are the codes, then they should be perfectly unique, which gives a list of choices of o (1) for each record.

Tags: Java

Similar Questions

Maybe you are looking for

  • How to search for music on external drive, while in I tunes

    I just bought the Mac Mini and have an external hard drive connected with my music on it.   I tried to click on search on iTunes, but could not get to find my music...   What is the best way to locate my music?

  • ThinkPad E540 USB 3.0 to USB 2.0 win 7.1

    I just bought the E540. Running to Win 7.1. I have 2 WD Passport 3.0 drives connected on a USB 3.0 hub. The 3.0 hub has the right cable for 3.0. They are not recognized as 3.0 devices (I get a message). I updated the USB 3.0 on the lenovo site driver

  • How to fix xp window crashed, will not boot windows

    my computer running windows xp media edition beginning custom all I get is a press f1 to start and I followed what he said and he just go back to the same screen to keep, I have tried everything that I get to the windows xp screen and nothing happens

  • Error 1303

    The Windows Setup program said all the time this error when I try to install the Sibelius music program. The message is; The willing istaller privileges insufficien to access this directory: AppData\Roaming\Avid. I am system administrator and with al

  • All-new Machine Windows 8 - windows update does not progress

    New Windows 8 machine (for my father) - had installed Office, Chrome and Firefox only.  Tried to go to Windows Update to ensure that it has been updated for the latest and best and he finds 65 updates, and he hung up download them. I came back a week