Would you please let me know why you need 8 variables when you have 8 records in DB? As far as I know, you should map your records to your object instances while you are mapping DB fields into member variables of a class. To hold a list of instances corresponding to your DB records, I think you should use Collections or Maps.