Solved

Java system generated username and password in a distributed environment

Posted on 2004-03-25
4
256 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
4 Comments
 
LVL 12

Accepted Solution

by:
Giant2 earned 63 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 62 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Purpose To explain how to place a textual stamp on a PDF document.  This is commonly referred to as an annotation, or possibly a watermark, but a watermark is generally different in that it is somewhat translucent.  Watermark’s may be text or graph…
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.
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 …

762 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now