File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes I/O and Streams and the fly likes Implementing Joins without database in java Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Reply Bookmark "Implementing Joins without database in java" Watch "Implementing Joins without database in java" New topic
Author

Implementing Joins without database in java

adity kommu
Greenhorn

Joined: Apr 08, 2010
Posts: 4


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

Joined: Jan 24, 2012
Posts: 31

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

Joined: Oct 29, 2001
Posts: 7921

Have a look at this article for some ideas.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
 
subject: Implementing Joins without database in java
 
Threads others viewed
SQL to HQL (Having issue in Left Outer Join)
Index not used on Tables in views
Joining 3 Tables
Large Map / HashMap
left outer join *= how make compitible in HQL
IntelliJ Java IDE