Actually
two cases
if the table RECRUITING exists then
answer AB
if it doesn't
answer BC
if the tabel RECRUITING exists then three sql statements executed
One for select
and two for update in the loop
answer : BC
C. is correct
There are just two sql statements
"SELECT oid, role FROM desp_roles WHERE role = ?"
and
"INSERT INTO RECRUITING (ID, NAME) VALUES(?, ?)"
it is not clear about RECRUITING table
if it doesn't exist then there is an
java.sql.SQLSyntaxErrorException: Table 'kwikorder.recruiting' doesn't exist
but anyway it was executed
B.
obviously thats right
they are two prepared statements created
query, update
F. failed
Connection and two PreparedStatements are automatically closed in tryWithResource exceptions.
A ResultSet object is automatically closed when the Statement object that generated it is closed, re-executed, or used to retrieve the next result from a sequence of multiple results.
actually there is just one ResultSet
ResultSet rs = query.executeQuery();
it executed just one timeand closed automatically after Prepatred statements
D. FAILED
see F
two SELECT queries and one INSERT INTO statement.
It creates two PreparedStatement objects: “query” for the SELECT query and “update” for the INSERT INTO statement.
2 prepare statemt ok
2 statements are executed independently of the number of times
upvoted 1 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
ASPushkin
2 months, 2 weeks agoASPushkin
2 months, 2 weeks agocathDev
3 months, 2 weeks agod7bb0b2
6 months, 1 week ago