Win a copy of liveProject: Protecting User Data with Spring Security and OAuth2 this week in the Spring forum!

Jay Chung

Greenhorn
+ Follow
since Jan 05, 2021
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
7
Given in last 30 days
4
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jay Chung

Q71 From https://www.examtopics.com/exams/oracle/1z0-809/view/15/ :

Q71
Given the records from the Employee table:
eid ename
111 Tom
112 Jerry
113 Donald
and given the code fragment:

Assume that:
The required database driver is configured in the classpath.
The appropriate database accessible with the URL, userName, and passWord exists.
What is the result?

A. The Employee table is updated with the row: 112 Jack and the program prints: 112 Jerry
B. The Employee table is updated with the row: 112 Jack and the program prints: 112 Jack
C. The Employee table is not updated and the program prints: 112 Jerry
D. The program prints Exception is raised.

My understanding is that:
1. rs.updateXXX(colName, newValue) //update columns IN ResultSet
2. Call rs.updateRow(); //to update IN db with (ResultSet updates commited to db…)

and here, although we are in TYPE_SCROLL_INSENSITIVE mode - that is to do with the db being changed by other means e.g. through different ResultSets,
here, we are updating the same ResultSet, so any updates to rows should be visible.

From this, the answer should therefore be:
The Employee table is not updated and the program prints: 112 Jack
(table not updated because rs.updateRow() was never called, but "Jack" because of 1.^)
which is not an option...

Can someone confirm if my understanding is correct and that the answers A/B/C/D are wrong?

Just figured it out, the answer will be 1.

i.e. updateRow()/refreshRow() changes will be visible because TYPE_ SCROLL_INSENSITIVE is about the changes made to the db by other means, if you change the same ResultSet, then you will see new values...
The following question from https://www.examtopics.com/exams/oracle/1z0-809/view/30 :

Q149
Given the records from the STUDENT table:
sid      sname      semail
111    James       james@uni.com
112    Jane         jane@uni.com
114    John         john@uni.com

Given the code fragment:

Assume that the URL, username, and password are valid.
What is the result?

A. The STUDENT table is not updated and the program prints: 114 : John : john@uni.com
B. The STUDENT table is updated with the record: 113 : Jannet : jannet@uni.com
           and the program prints: 114 : John : john@uni.com
C. The STUDENT table is updated with the record: 113 : Jannet : jannet@uni.com
           and the program prints: 113 : Jannet : jannet@uni.com
D. A SQLException is thrown at run time.

Answer is D because rs.updateRow()/rs.refreshRow() cannot be called on the insert row...

But I was wondering what would happen if we replaced
rs.updateRow();
rs.refreshRow();
for
rs.insertRow();

?

1.
would C be correct?

OR

2.
would it still be an SQLException because we are in TYPE_SCROLL_INSENSITIVE mode?

Can someone confirm whether 1. or 2. is correct or maybe a totally different answer? :/

Piet Souris wrote:I think that it has to do with boxing: an Integer can be boxed to a double, but not to a Double. And my terminology may be wrong...



Ah yes of course! I forgot that DoubleSupplier's abstract method returns double rather than Double!
Found the following question in https://www.examtopics.com/exams/oracle/1z0-809/view/19/ :

Given:

What is the result?
A. IT:null
B. A NullPointerException is thrown at run time.
C. A compilation error occurs.
D. IT:0.0

The answer is B - fine.
But I was playing around with the code and replaced
with


and in doing so I thought that the line



would fail to compile as a result, because we know that something like

would not compile.

but it did compile ok...

Anyone got an explanation for this? :/

Mike Simmons wrote:

Jay Chung wrote:in this case, I would've thought that line * follows rule B, but if that were the case, then it would be
Predicate p = Predicate(), which then should cause * to NOT COMPILE as it does not implement
public boolean test(Object o)


Your interpretation is pretty good, but a little off.  In rule B, it's not that the compiler treats new ObjectInstance<Type>() as new ObjectInstance() for the entire statement.  Rather, it makes that substitution, ignoring the generic parameter, while evaluating the assignment part (the =).  So think of the compiler as looking at the expression in different parts.  First:

This part makes sense on its own - a CourseFilter needs to have a boolean test(String).  Great!  The compiler is happy with this.

And then this part:

When the compiler looks at the assignment, it basically asks itself, can the thing on the right be treated as the thing on the left?  Which in this case means, can a Predicate<String> be treated as a Predicate?  The answer is yes, it's willing to ignore the generic part and let the assignment take place.  If you want to treat this as a raw Predicate, you can, the compiler will let you.  However that doesn't mean it's re-evaluating the entire right hand side to make it conform to the raw Predicate type.  The right hand is still a Predicate<String>, with a test(String) method.  And the assignment is allowed to happen.

Now at run time, you may still run into problems.  What happens if you run the following?



Yeah makes sense, the last print line causes exception because LHS reference type determines what method is called, in this case test(Object o) since LHS uses no generics.

I also tested the opposite:


Looks like this breaks rule A (line *) and I'm guessing it's the same reason you just outlined for the opposite way - the compiler independently checks


before independently checking


1. is that correct?

2. And so to conclude, it seems that rule A and B DO hold, except for cases when RHS is an anonymous class...
In this case, perform 2 independent checks:
-first check the anonymous class implements the superclass/interface correctly,
-then check the assignment is correct.

Would you agree with these statements? (sorry for all the questions - super stressed   )
Looking at the following code:

1.

2.


it seems like from 1. we have:
A: ObjectInstance<Type> o = new ObjectInstance(); is treated like ObjectInstance<Type> o = new ObjectInstance<Type>();
And from 2. we have:
B: ObjectInstance o = new ObjectInstance<Type>(); is treated like ObjectInstance o = new ObjectInstance();

But then I saw some other question which breaks these rules:


in this case, I would've thought that line * follows rule B, but if that were the case, then it would be
Predicate p = Predicate(), which then should cause * to NOT COMPILE as it does not implement
public boolean test(Object o)
But it does compile ok...

Can someone confirm whether my interpretation of A and B are even correct and if not, are there some rules to follow with this kind of thing?

Paul Anilprem wrote:
Although not too scientific, you may want to check out this 1z0-809 average score comparison page, which shows that people usually score higher on the real exam.
So, from that perspective, your score isn't actually bad. The more worrisome fact is that your score decreased in the last three tests. You need to analyze your results and see what kind of mistakes are you making. Are you making the same mistakes again and again or the test hit upon new topic/tricks that you had not read about?



I am just marking my last day test today and I see that it's a mix of wrongs from new tricks and silly mistakes (which I can remember that I rushed that specific question that I made a silly mistake on)...
How can I overcome timing issue? I check time and try to do 20 per 30 mins but if I'm behind I try to speed up a bit to catch up, which then leads to me rushing and making those silly mistakes?? D:

Who's idea was it to put more questions than OCA but same time limit when on top of that each question is also harder?!      
I posted this in the wrong forum, how do I delete it lol?
2 months ago
I started revision around December and plan to sit this exam at the end of April.

I have been studying with the guide by Jeanne Boyarsky and Scott Selikoff and made my own condensed notes based on this.

When doing the review questions at the end of December, I scored the following (on 1st attempt):
Assessment test: 85%
1. Advanced Class Design: 90.5%
2. Design Patterns and Principles: 90%
3. Generics and Collections: 88%
4. Functional Programming: 80%
5. Dates, Strings, and Localization: 85%
6. Exceptions and Assertions: 90%
7. Concurrency: 68%
8. IO: 74%
9. NIO.2: 80%
10. JDBC: 90%

So I spent a few more weeks studying and making sure I understood what I got wrong and when reattempting these I got 80+ in every topic. At this point I decided to invest in Enthuware.
This is when my confidence dropped massively...

My Enthuware test scores (on 1st attempt - taken this month in February):
Foundation: 83%
Test 1: 73% - 2 mins left
Test 2: 69% - 10 mins left
Test 3: 70% - 4 mins left
Test 4: 78% - 14 mins left
Test 5: 75% - 16 mins left
Last Day Test: 71% - 1 min over (D:)

As you can see, the scores are significantly lower than what I got in the review questions from the book, and I barely finished with any time at all... :/
Is the real exam really easier or???

Assuming I revise everyday after work for a few hours, is end of April reasonable for sitting the exam? What are peoples' advice to speed up my timing?
I started revision around December and plan to sit this exam at the end of April.

I have been studying with the guide by Jeanne Boyarsky and Scott Selikoff and made my own condensed notes based on this.

When doing the review questions at the end of December, I scored the following (on 1st attempt):
Assessment test: 85%
1. Advanced Class Design: 90.5%
2. Design Patterns and Principles: 90%
3. Generics and Collections: 88%
4. Functional Programming: 80%
5. Dates, Strings, and Localization: 85%
6. Exceptions and Assertions: 90%
7. Concurrency: 68%
8. IO: 74%
9. NIO.2: 80%
10. JDBC: 90%

So I spent a few more weeks studying and making sure I understood what I got wrong and when reattempting these I got 80+ in every topic. At this point I decided to invest in Enthuware.
This is when my confidence dropped massively...

My Enthuware test scores (on 1st attempt - taken this month in February):
Foundation: 83%
Test 1: 73% - 2 mins left
Test 2: 69% - 10 mins left
Test 3: 70% - 4 mins left
Test 4: 78% - 14 mins left
Test 5: 75% - 16 mins left
Last Day Test: 71% - 1 min over (D:)

As you can see, the scores are significantly lower than what I got in the review questions from the book, and I barely finished with any time at all... :/
Is the real exam really easier or???

Assuming I revise everyday after work for a few hours, is end of April reasonable for sitting the exam? What are peoples' advice to speed up my timing?
2 months ago
Is enthuware really that hard compared to real exam??? I am doing enthuware and can barely get 70s but it's really demoralising D: - can anyone confirm?
2 months ago