• Post Reply Bookmark Topic Watch Topic
  • New Topic

Has Map  RSS feed

 
Ram Adsumalli
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

I want to expalin my scenario in my masters project. Can any one help me with the pseudo code or their Veiws. So that I can code myself.

Question.

I need to retrive the value for the User( Column) from the database and and also i need to store default values like Roll numbers and subjects(Variables) in the Hash Map or Hash Table . Can any one help me how to write the pseudo code and give.

I can retrive the Value User Value from the Database.My question is how to declare the default variables with the values and store in the HaspMap in Java Class

If i am confusing you with my question please bear with me.

Regards
Ram
 
Srikanth Basa
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you wish to maintain a HashMap per user and the key being the Strings like UserName , RollNumber, Subject1, Subject2 .... and their values in HashMap being the values retrieved from the database.

If you are integrating this logic into an application then it may look good to make the default parameters configurable. Say when you get a Subject 1 marks as null then you wish to store the value as "NA" or something similar.

One good option will be to make these default values configurable. Well, that always depends on how your whole application goes.

So you will use some config file which says Subject1 defaults to NA, Country defaults to US ... blah blah blah....

So when you identify that a value retrieved from DB is null, you pickup the default configured values and place that in the HashMap.

Hope this helps.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!