aspose file tools*
The moose likes Beginning Java and the fly likes HAshMap to Excel file using APache POI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "HAshMap to Excel file using APache POI" Watch "HAshMap to Excel file using APache POI" New topic
Author

HAshMap to Excel file using APache POI

sai rama krishna
Ranch Hand

Joined: May 29, 2009
Posts: 251



I have above program which reads File.xls for username and password info like above. From the missedList hashmap I need to send the username,password information to a excel sheet using apache POI. Please advise on how to send achieve it. Any ideas, suggestions, sample code, links, source code highly appreciated. Thanks in advance

I checked folowing link but does not have what I am looking

http://www.mysamplecode.com/2011/09/generate-large-excel-in-java-using.html

Any ideas, suggestions, sample code, links, source code highly appreciated. Thanks in advance
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2416
    
    7

Hello there

So you are trying:
1) get the username and password from the excel file
2) pass these 2 values to some SQL checking against database if such entry exists
3) if NOT populate this username/password pair into a map and add this map into a list


Also when you loop through your database result set you don't necessarily need to check for null because if there are no records, the rs1.next() will return false and exist the while loop. At this point you will add this so-called missing username/password to your map and list.

Also to simplify your code, why use a list of maps? When you can just use a map since you are working with username/password pairs.

Hope this helps.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HAshMap to Excel file using APache POI