• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HAshMap to Excel file using APache POI

 
sai rama krishna
Ranch Hand
Posts: 432
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



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
Posts: 3507
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic