• 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

Workstation Client Name

 
Ranch Hand
Posts: 333
1
Mac Eclipse IDE Safari
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would very much like some advice on the best way to get the users true computer name. I have an application which needs to determine the users pc name. I am currently using :-

clientname = InetAddress.getLocalHost().getHostName().toLowerCase();

to get the name when the application is running on the users local machine. However it is quite possible that the user may be running the application via a remote terminal server session in which case I would NOT want all the users to get the same servers host name.

Any advice appreciated.

Dave
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Or they could be running it via SSH, or via FTP's RCMD command... I doubt there is an easy way to find out the ultimate computer where the user is tapping the keyboard.

Can we back up a step and ask you to explain why you need this information?
 
David Garratt
Ranch Hand
Posts: 333
1
Mac Eclipse IDE Safari
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sure,

My client application has been written to work with a number of different databases. As such I have avoided the use of proprietary methods like sequences or stored procedures to generate unique numbers. My specific application only needs to generate a pallet number and it will suffice for each workstation to have it's own range. I intend to have a table containing client worktation names and when a number is required the applciation will read/increment and store the next number against the record correspodning to its client name. This will avoid and possibility however slight that two workstations will get the same number.

Thanks

Dave
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Couldn't you have logins and base your sequence numbers on user identities instead of workstation identities?
 
Paul Clapham
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Agreed. Or perhaps configure your workstations so that only one user can sign on at a time.
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
another option is to have this lookup table bound to the MAC address of client machine. You can get this information, but only starting with JDK 1.6
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic