Win a copy of Kubernetes in Action this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to compare two Hashmap contents.  RSS feed

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • 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.
 
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just get the key and find out whether both the maps has same value object or different.
 
author & internet detective
Marshal
Posts: 37714
579
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • 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: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • 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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!