Solved

Java system generated username and password in a distributed environment

Posted on 2004-03-25
4
290 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 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

726 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