• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

newbie question

 
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have two tables :
users (id, firsname, lastnime, username, password, rolekey)

roles (id, rolename)

In my LoginAction I need a call to a method getInfo(username, password) of another class Services to get the username and the rolename, my question is how I am going to save username and rolename in getInfo(...) and how I will pass get them back in LoginAction ??

Thank you.
 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From what I understand....
You want getInfo method to return the userName and password.

If your userName and password are object variables(which I assume they must be of type String...) then remember, in Java, objects are passed by reference. So whenever you call a method by passsing these objects as parameters, the values assigned to them in the called method, remain till the scope of existence of that object variable(which in your case would be the calling method, if the variables have been instantiated there..).
so even if ure method getInfo returns a void... your userName and password will have the values assigned to them in the getInfo method.
 
reply
    Bookmark Topic Watch Topic
  • New Topic