How do I set this value?

I have a class:
MysqlConnect

In here I do this:

while((rs!=null) && (rs.next()))
            {
                  Item item = new Item();
                  item.setID(Integer.valueOf(rs.getString(1)).intValue());
                  item.setNamn(rs.getString(2));
                  item.setPrice(Integer.valueOf(rs.getString(5)).intValue());      
                  
                  lista.add(item);
            }

Now I want also to set  a value called Betyg. In my Items class it looks like this:
public class Item {
            private int _varuId;
            private int _pris;
            private String _namn;
            private KategoriID _kategoriId;
            private Betyg _betyg;
.....

so my problem. How do I set the Betyg in my class mysqlConnect.

My Betyg class looks like this:
public class Betyg {


      private String _text;
      private int _betyg;
      private int _varuid;
      private String _pnr;
      
.....


MickeysAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mick BarryJava DeveloperCommented:
while((rs!=null) && (rs.next()))
            {
                  Betyg betyg = new Betyg();
                  betyg.set......

                  Item item = new Item();
                  item.setID(Integer.valueOf(rs.getString(1)).intValue());
                  item.setNamn(rs.getString(2));
                  item.setPrice(Integer.valueOf(rs.getString(5)).intValue());      
                  item.setBetyg(bethg);

                  lista.add(item);
            }

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Gibu GeorgeChief Technology OfficerCommented:
Betyg  betyg=new Betyg();
then set the values in Betyg
then item.setBetyg(betyg)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.