• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HAshMap to Excel file using APache POI

 
Ranch Hand
Posts: 930
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic