I working on a project where I have to connect the specific database based on the bank_name.I am using java,struts2,hibernate.
for example:
{'sbi':
{'host':'111.111.15.45','port':3306,'username':'xxxx','password':'xxxx','database':'sbidb'}
Here sbi is a bank_name which is a key,then as a value there is another map. so I want to retrieve all values such as host,port,db based on bank_name(ex: ‘sbi’).
How to achieve this?
This is simple.
You Map is something like this:
Now you can retrieve the key value pair from inner map as below:
This will print all inner keys and corresponding values in the map for
sbi.