HI all,
please any one help,its very urgent.I need to store one table in an object (collection) then want to retrieve. so i have confusion which is the best method to use whether list,map,set........ etc and my table values are upto 11 records.

Recommended Answers

All 12 Replies

You haven't given much background to help anyone pick the rigt answer, but, in general, if the columns are of various types, then you would be pretty safe with creating a class to represent one row (instance variables for each column) then having an ArrayList of those instances to represent all the records.
Of course it's highly possible that something you didn't mention in your post could completely change that answer...

I should have onetime server hit to get db values and populate to a static map(that should be used as a cache for client side validations).
But the value should not be a VO,what is teh other ways to implement this instead of using a VO. 

i clear with my quesion...................................any one help me to solve this.....................

very urgent, is usually a rought translation of:

Yeah, I was given this task two weeks ago, but didn't bother until five minutes before the deadline.

so I think it's clear why we don't all jump to the occasion of doing your job for you.

first thing you do: check your coursenotes, or online, what the differences, advantages/disadvantages are between the different implementations. then, you compare that to your needs.
the next thing to do is, to implement the one you would benefit of.

What do you mean by VO ?

my guess: he means a DTO. formerly Value Object.
Go Wiki

... although that leaves me even more puzzled by OP's latest - what is he describing in his first post if not a DTO?

his homework assignment? :)

vo is value object class

i dont know how to get this concept. i am not much talent in collection.i want how to get onetime server hit to get db values and populate to a static map

so .... it has to be a DTO, but it's not allowed to be a DTO?
we're going Shakespearian here: to DTO, or not to DTO .... now THÁT's the question.

Maybe this means that it has to be implemented just using standard Collection classes, with no custom-written VO/DTO classes? (?)
In which case maybe:
Store each record in a HashMap with column names as the keys and the data as values, then put all those into an ArrayList?

you're too late, James. If it really were that urgent he'll have self combusted by now or worse.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.