![]() |
|
#1
|
|||
|
|||
How Can I Check on DatabaseDear all,
I have the problem on Inserting the Database Table field I need to check that entry already in that tables If there I want to produce error message and want to produce the message to re enter only that error data. This piece of code that, I used to inserting data from the keyboard to produce the one Class object return values, After that I'll going to insert on the Database. But the thing is How Can I check after entering University ID, I want to check that data already stored in database or not???? JAVA Code:
I will get out put like this while the piece of code executing Quote:
Each line prints(Black in color), I'll enter the details(Green In color) and pres enter key. My problem is how can i check that database consist that University Id on our Database. Please try to solve this problem soon. |
|
#2
|
||||
|
||||
Re: How Can I Check on DatabaseI'm assuming, that there is some sort of DB connectivity to the application, and not a "memory-based" DB scheme...(like link-listing?)
Anyway, query the database to see if the ID already exists. To me, it seems that generating an error might be 'overkill'. Prechecking the ID, and if one exists, then simply use that ID to associate the other information in the related table. [this assumes a good relational model, of course] So, the query, depending on the table design around the 'University ID' might use one of these general SQL formats: Code:
__________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! |
|
#3
|
|||
|
|||
Re: How Can I Check on DatabaseTahnk you turbo,
In my case Taht I thought Before reading all Data from the user I'll generate the message to user that "You gave University ID's person already registered on the Libray System" otherwise It will allows to read the rest of the date from the user. Ya you got my point I have created Databas using MySQL, I have thought like Enter University ID : SEU/IS/01/BS/17 " After this going to check" Then if the data alraedy exists call repeatedly Enter University ID : Otherwise calling rest of the parts as follows, Enter Name : Abdul Haleem Enter Member ID : 555 Enter Member Catergory : STU Did you got my view ? |
|
#4
|
||||
|
||||
Re: How Can I Check on DatabaseYes, I think the "...already registered..." message is better than an error.
However, think about this: the University ID, by itself, might not be enough to tell that someone is "already registered", but of course I don't know what the codes in your University ID indicate. (because if the University ID is merely a course reference, surely more than one person will be allowed to take that course!) It might be necessary to get the University ID and maybe a member ID pair to get a true, specific registration. __________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! |
|
#5
|
|||
|
|||
Re: How Can I Check on DatabaseDear Turbo,
University_ID is the Unique key for an student or staff in the university but in my Librarysystem Database memberID is the primary Key. But I thought any one situation some one may tries to register twice by the mistakes, so I thougt to eleminate the constraints at the beginning of the entering database. Afeter checking all the values charect format, final result of the information want to stores on the Database. this is my member class : JAVA Code:
|
|
#6
|
||||
|
||||
Re: How Can I Check on DatabaseQuote:
__________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! |
|
#7
|
|||
|
|||
Re: How Can I Check on DatabaseDear turbo,
i asked some problem on my private post, please give me some suggestion. |
Recent GIDBlog
Flickr uploads of IA pictures by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need help understand function prototypes! | Blstretch | C++ Forum | 20 | 25-Oct-2005 14:14 |
| Help with Classes and database arrays | brookeville | C++ Forum | 1 | 13-Apr-2005 00:26 |
| Limit combo box and date time picker choice according to database created in folder | shinyhui | C++ Forum | 0 | 22-Feb-2005 20:16 |
| Limit combo box and date time picker choice according to database created in folder | shinyhui | MS Visual C++ / MFC Forum | 0 | 22-Feb-2005 02:13 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The