wood burning stoves 2.0*
The moose likes JDBC and the fly likes how to related two tables 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 to related two tables " Watch "how to related two tables " New topic
Author

how to related two tables

Syskata Mitev
Ranch Hand

Joined: Aug 23, 2006
Posts: 51
i have a simple user login and use this code to make two tables


I wont when I try to user_log.role_id to make call to role_id.role_name or something like that.
Can you someone help me to make relation ship between them whit role_id or give me a little more information how to make it possibility.
Thanks in advance!
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30136
    
150

Originally posted by Syskata Mitev:
I wont when I try to user_log.role_id to make call to role_id.role_name or something like that.

I don't follow what you mean by this.


Can you someone help me to make relation ship between them whit role_id or give me a little more information how to make it possibility.

It sounds like you want to create a foreign key relationship between the two columns. This means that a column on one table (user_log) refers to the primary key of another table (role_id).


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Syskata Mitev
Ranch Hand

Joined: Aug 23, 2006
Posts: 51
Thanks a lot. That's exacly whot i need. But i have a basic practice in this area so please give some example how to make it.
Thanks again.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30136
    
150

Wikipedia has a good example.
Syskata Mitev
Ranch Hand

Joined: Aug 23, 2006
Posts: 51
Thank you. I find what i wont for now. JavaRanch rules;)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to related two tables
 
Similar Threads
MySQL / jdbc + Java Servlet
Glassfish + jdbcrealm
Hypersonic DB question
SQL Error
Creating a view combining two columns into one