wood burning stoves 2.0*
The moose likes JDBC and the fly likes how can i join the tables and display the related column in datatable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "how can i join the tables and display the related column in datatable" Watch "how can i join the tables and display the related column in datatable" New topic
Author

how can i join the tables and display the related column in datatable

jammie james
Greenhorn

Joined: Jun 17, 2011
Posts: 1
Hi all,

May i have your guide how can i join the tables and display the related column data in a datatable?

Says that....

1) Table A consist column (Shelf,Food Type) and Table B consist columns (Food Type, Food Description).
2) In the .jsp, i have declared 2 datasource for both Table A and Table B and 1 datatable.

May i know how can i use the .addcolumn and .addjoin in the .java (the controller file for .jsp) in order to
join both of the tables and display data for TableA.shelf and followed by TableB.Food Description in the datatable i have declared in .jsp?

I viewed the .addcolumn function description :
/**
0178: * This method adds a column to the DataStore using the datastore's default
0179: * table.
0180: *
0181: * @param column
0182: * The name of the column to add to the datastore.
0183: * @param type
0184: * The type of the column to add to the datastore. This must be
0185: * one of the "TYPE" constants in the class.
0186: * @param primaryKey
0187: * True if the column is part of the primary key of the table it
0188: * is in.
0189: * @param updatable
0190: * True if this column should be updated when the update method
0191: * is called.
0192: * @see DataStore#setDefaultTable
0193: */
0194: public void addColumn(String column, int type, boolean primaryKey, boolean updatable)

But, I don't understand what is the meaning of type of column...

I hardly find correct examples that shows how to apply .addjoin and .addcolumn.
Hereby hopes to have your guide on this.

Thank you and have a nice day.

Jam
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how can i join the tables and display the related column in datatable
 
Similar Threads
Retriving data from two tables where there is no physical relation ship in hibernate
org.hibernate.LazyInitializationException:
Choice of Implementation
Display Tag css issues in IE and FF
Could not determine type for: java.util.Set