Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Java system generated username and password in a distributed environment

Posted on 2004-03-25
4
Medium Priority
?
309 Views
Last Modified: 2010-04-17
I want to develop a distributed student registration system which will allow several administrators to enter student information in textfields and submit this information to the database, to create their records concurrently. The system should then automatically create a username in the form(200400001 as the first username) and a unique password made up of digits and characters. This username and password should also be submitted to the database in the same table where the student information is stored. The problem is how can I synchronize the username creation to allow several administrators to create student records at the same time.I will appreciate any suggestion of code or idea. Note: The system I am developing is client/ server and I am using sockets for communication of the client process and the server process.
0
Comment
Question by:bidden
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 12

Accepted Solution

by:
Giant2 earned 252 total points
ID: 10684950
I think there are 2 solutions (I think the second is better):

1) You must define a key field (like USmedical-code or other) that is unique for each student, so the password/username can be generated without worry it's unique.

2) Send the request without the password/username to the server. The server generate the password/username and answer to the client which made the request the real password/username

Bye, Giant
0
 

Assisted Solution

by:jmtonn
jmtonn earned 248 total points
ID: 10691426
You could use transactions in the database to force simultaneous entries to take turns being written.

http://www.cleardata.biz/articles/transactions.aspx

What database are you using?
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Make the most of your online learning experience.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question