Question related to JoinRowSet

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
The_Nick
Posts: 132
Joined: Thu May 16, 2013 9:23 am
Contact:

Question related to JoinRowSet

Post by The_Nick »

Hi,
Let's say that I join 2 tables each one of 4 columns, BOOK and AUTHOR.

matched with ID column for AUTHOR and IDAUTHOR for BOOK

I will have an output of 8 column in7 the database if I join the two;
However getMetaData().getColumnCount() in the program gives me back 7.

Apparently of the matcher columns only one of the two tables are actually reported to the Java layer;
Is there a rule to determine which of the matcher column is going to be taken and which not?
for example rule such as " If I add first a rowset representing AUTHOR and then a rowset representing BOOK, it's ID the column to be shown and not IDAUTHOR and if I did the other way round it would be viceversa?
EDIT: yes it is I have just tried. However why? and what if there were more than 2 tables to join?

Thanks in advance.

admin
Site Admin
Posts: 10396
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: Question related to JoinRowSet

Post by admin »

The documentation of JoinRowSet doesn't say much about how the getMetaData should behave other than, "If the RowSet object is the first to be added to this JoinRowSet object, it forms the basis of the JOIN relationship to be established." So whatever you observation is how the implementation works. It can't be relied upon though.

But really, the question, "which of the matcher column is taken" is not important because it will have the same values for both the columns (since you are matching on that column).

I don't see how adding multiple RowSets makes any difference.

HTH,
Paul.

The_Nick
Posts: 132
Joined: Thu May 16, 2013 9:23 am
Contact:

Re: Question related to JoinRowSet

Post by The_Nick »

Hi Paul,
I am just considering any possible tricky question for the exam:
Here is another doubt generated from reading this oracle java tutorial: docs.oracle.com/javase/tutorial/jdbc/ba ... owset.html
At this point, in addition to the default properties, the priceList object contains the data in the COF_NAME and PRICE columns from the COFFEES table and also the metadata about these two columns.
What does it mean that the other disconnected row set do not save the metadata?
If not what is that is "in addition" in respect to the other disconnected rowsets?

Thanks in advance.

The_Nick.

The_Nick
Posts: 132
Joined: Thu May 16, 2013 9:23 am
Contact:

Re: Question related to JoinRowSet

Post by The_Nick »

Yes, I have just realized that they mean the metadata of the columns,
However by trying the webrowset out I get the following:

Code: Select all

<sync-provider-name>com.sun.rowset.providers.[b]RIOptimisticProvider[/b]</sync-provider-name><sync-provider-vendor>Oracle Corporation</sync-provider-vendor><sync-provider-version>1.0</sync-provider-version><sync-provider-grade>2</sync-provider-grade><data-source-lock>1</data-source-lock></
Previously in another tutorial they said that WebRowSet is the only one who change RIOptimisticProvider to RXMLProvider... maybe it converts it after writing on a db.. i'll update the thread after tried.

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests