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
Solved

Java system generated username and password in a distributed environment

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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.
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…
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…

856 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