wood burning stoves 2.0*
The moose likes JDBC and the fly likes How can I store USERID automatically in Oracle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How can I store USERID automatically in Oracle" Watch "How can I store USERID automatically in Oracle" New topic
Author

How can I store USERID automatically in Oracle

subir adhikari
Greenhorn

Joined: Jul 17, 2012
Posts: 4
In a simple servlet program I am creating profiles for different persons registering with the application.The related "registration" table has a "USERID" column where the users' unique "USERID" will be stored. Now I have another table named "MEAL" which has the same column "USERID" which is primary key to "registration" table. When an user will select a meal to be taken from meal selection page corresponding meal data are saved to "MEAL" table.Now I wish the corresponding USERID to be automatically stored in the "USERID" column of the "MEAL" table. So how can I achieve this functionality?Please help me on this!!
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

What do you mean by "automatically"?
mallikarjun dontamsetti
Ranch Hand

Joined: Mar 18, 2011
Posts: 243

how the user is taking meals? how you are identifying which user is taking meals? if you now that user, who is taking meals you can get that "USERID" value(because it is a primary key) and insert it in the meals table.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Yes, exactly. Why not just store the user value in the table just the same way you store the meal value?
subir adhikari
Greenhorn

Joined: Jul 17, 2012
Posts: 4
I user session and solved the issue!!Thanks!!
 
 
subject: How can I store USERID automatically in Oracle
 
Similar Threads
JSP Code for my Module
Netbeans 6.1 webuijsf:Addremove problems.
db desgin question: how to improve the relationship in this schema
Beginner Problem: son & parent
How to implement Session Tracking