About Question enthuware.ocpjp.v11.2.3614 :
Moderator: admin
-
- Posts: 2
- Joined: Tue May 04, 2021 1:53 pm
- Contact:
About Question enthuware.ocpjp.v11.2.3614 :
There is one QUERY and two UPDATES, when one of the answers was: "It will execute three STATEMENTS (or maybe SQL commands) on the database." then that answer will be correct.
-
- Site Admin
- Posts: 10384
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v11.2.3614 :
Although select/update/insert are all queries but I agree that statement would be clearer. Please be aware that the real exam uses the word query for all sorts of queries.
-
- Posts: 9
- Joined: Tue Nov 26, 2024 2:08 pm
- Contact:
Re: About Question enthuware.ocpjp.v11.2.3614 :
Hi!
First, there's a very small spelling error in the second and third answers, I think "querries" should be "queries", but that doesn't matter much.
I answerd this incorrectly because I assumed it'd throw an SQLException trying to update through the ResultSet at since it wasn't created with any int resultSetConcurrency, especially lacking the ResultSet.CONCUR_UPDATABLE.
https://docs.oracle.com/javase/8/docs/a ... ltSet.html mentions at the description in the top:
It will execute one query on the database.
and
It will throw an exception at //1
So I think my mistake was that in this context, I read "updatable" in the javadoc and tutorial as "being able to executeUpdate() on the resultset" but I should have interpreted it as "refreshable" as in "refreshRow() actually loads the new data". Is that correct?
It's hard for me to get a grip on JDBC when certain rules/ agreements are interpreted differently by different database vendors so trying things out with SQLite might give different results than trying it out with let's say MariaDB. It's all a little bit abstract without having a setup where I can try things out while knowing that quirks are not caused by vendors or certain versions. Any tips on how I could improve that are very welcome but I understand it very well if you can't provide that.
Thank you for your time!
First, there's a very small spelling error in the second and third answers, I think "querries" should be "queries", but that doesn't matter much.
I answerd this incorrectly because I assumed it'd throw an SQLException trying to update through the ResultSet at since it wasn't created with any int resultSetConcurrency, especially lacking the ResultSet.CONCUR_UPDATABLE.
https://docs.oracle.com/javase/8/docs/a ... ltSet.html mentions at the description in the top:
This is backed by the Java Tutorials at https://docs.oracle.com/javase/tutorial ... eving.htmlA default ResultSet object is not updatable and has a cursor that moves forward only.
So I wrongly chose the following answers:There are two concurrency levels:
CONCUR_READ_ONLY: The ResultSet object cannot be updated using the ResultSet interface.
CONCUR_UPDATABLE: The ResultSet object can be updated using the ResultSet interface.
The default ResultSet concurrency is CONCUR_READ_ONLY.
It will execute one query on the database.
and
It will throw an exception at //1
So I think my mistake was that in this context, I read "updatable" in the javadoc and tutorial as "being able to executeUpdate() on the resultset" but I should have interpreted it as "refreshable" as in "refreshRow() actually loads the new data". Is that correct?
It's hard for me to get a grip on JDBC when certain rules/ agreements are interpreted differently by different database vendors so trying things out with SQLite might give different results than trying it out with let's say MariaDB. It's all a little bit abstract without having a setup where I can try things out while knowing that quirks are not caused by vendors or certain versions. Any tips on how I could improve that are very welcome but I understand it very well if you can't provide that.
Thank you for your time!
Who is online
Users browsing this forum: No registered users and 7 guests