Solved

Java system generated username and password in a distributed environment

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

Industry Leaders: 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

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.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
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 …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

690 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