This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes help me with unique client Ids Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "help me with unique client Ids" Watch "help me with unique client Ids" New topic
Author

help me with unique client Ids

Siddharth Mehrotra
Ranch Hand

Joined: Aug 21, 2001
Posts: 185
hi guys.
can anyone help me in getting unique client ids.
i 'am using hashcode to generate it.
but if i start two clients on the same JVM then the clientID remains same. well that doesnot create a problem in standalone mode.
but for n/w mode this will be a big problem.
even though it is a ridiculous thought of having two clinets running n/w access from same system.
point to note is that i'am generating unique ids on the client( i hope i'am doing proper)


SCJP, SCJD.
Leonardo Penha
Ranch Hand

Joined: Feb 15, 2002
Posts: 68
There is a class in the JDK which called VMID. It should help you solve your problem.


Leonardo Penha<br />SCJP, SCJD, SCWCD, SCEA, SCMAD, SCDJWS
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Siddharth,
Some more possibilities are UID and ObjID. I haven't got this one totally worked out either. So if you come up with something solid let me know.
Michael Morris


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
xiaoma wang
Ranch Hand

Joined: Mar 04, 2002
Posts: 74
hi,
In my design, i have a class names IDGenerator and only has one static method: generateId() and a static int variable. whenever this method is called, it will return a unique "id". let this class work in your server in which u want a unique id return to the client.
Hope it helps!
Xiaoma Wang
Siddharth Mehrotra
Ranch Hand

Joined: Aug 21, 2001
Posts: 185
hi,
i'm using java.rmi.server.UID class for generating unique ids.
and it does generate unique ids.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: help me with unique client Ids
 
Similar Threads
flooding of tree in applet thro' servlet with the help of database
Client ID?
Extending ClassLoader(getResource) Functionality: Questions
how do i differentiate two instance or client
Share data between jsp and servlet without using request or session