Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Implementing Joins without database in java  RSS feed

 
adity kommu
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I have 2 CSV files which contains 50 records of each . Now i have to read values from these CSV files and perform different join operation(Full outer join , left outer join , etc) .how do i do this a reply would be helpful.Please give a detail explanation. Thank you
 
Deepak Rao
Ranch Hand
Posts: 36
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adity

I am not sure of any java package to do this. If your operations are mainly with a single primary key column then you can try loading these CSV's into a suitable datastructure,like Hashmap, where the key is the unique primary key and the value could be an object of a class defined by you. Or anyother better datastructure.

But if your joins and conditions involve many columns or the number of rows are large, then IMHO you should use something like a HSQLDB or some inmemory DB to perform your standard SQL operations.

Thanks
Deepak
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at this article for some ideas.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!