wood burning stoves 2.0*
The moose likes JDBC and the fly likes Joins Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Joins" Watch "Joins" New topic
Author

Joins

Kris Reid
Ranch Hand

Joined: Jan 05, 2005
Posts: 247
Best explained with code



How do you know which "field" you are getting from the resultSet?
How do you specify which "field" you want?
i.e. rs.getString("tableOne.field");
Sri Ram
Ranch Hand

Joined: Oct 03, 2005
Posts: 118
what u can do is, give a virtual column name and then getString based on that name.
Sample Code.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60766
    
  65

"Sriram TA",

There aren't may rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Kris Reid
Ranch Hand

Joined: Jan 05, 2005
Posts: 247
Didn't even think of Aliases!

Thanks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Joins
 
Similar Threads
Callable Statements: how do I name the input parameters?
how to remove exception
Putting a ResultSet into an Array
SQL Statement not Returning Date
retrieved data from database and tick JTextBox in my form automatically