• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

how to compare two Hashmap contents.

 
Rupa Katkar
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have created two hashmaps, it contains database table .
Now i want to compare values of both .
how should i compare it.
 
Sagar Rohankar
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just get the key and find out whether both the maps has same value object or different.
 
Jeanne Boyarsky
author & internet detective
Posts: 41071
848
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rupa Katkar wrote:I have created two hashmaps, it contains database table .


What type of object is in the HashMap? A database table isn't a Java type, so it must be something else.
 
Rupa Katkar
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:

Rupa Katkar wrote:I have created two hashmaps, it contains database table .


What type of object is in the HashMap? A database table isn't a Java type, so it must be something else.



Hi,

Hashmap contains contents of database table.

Actually i solved that problem of comparison, another new problem i am having
it is
..
After making the comparison of two hashmap, i got some results.
For eg. difference between two amount. Now i want to transfer this result to
jsp page for displaying purpose, how should i do this.
Pl. tell me.
 
Sagar Rohankar
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rupa Katkar wrote: After making the comparison of two hashmap, i got some results.
For eg. difference between two amount. Now i want to transfer this result to
jsp page for displaying purpose, how should i do this.
Pl. tell me.


JPS things should be asked in JSP section, still here is the quick answer:

1. Put the values you want to display on JSP page in request scope.
2. Access them using the EL, JSTL, but never using scriptlet
 
BWA HA HA HA HA HA HA! Tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic