This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
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: 245



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: 2380
    
    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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: HAshMap to Excel file using APache POI