1D0-441 · Question #105
Which statement best describes database metadata extraction using result sets?
The correct answer is B. The DatabaseMetaData interface is used to extract data about the DBMS and the database. See the full explanation below for the reasoning.
Question
Options
- AThe ResultSetMetaData interface is used to extract data about the DBMS.
- BThe DatabaseMetaData interface is used to extract data about the DBMS and the database.
- CThe ResultSetMetaData interface is used to extract data about the database, the DBMS, and a
- DThe DatabaseMetaData interface is used to extract data about a result set.
How the community answered
(30 responses)- A3% (1)
- B73% (22)
- C17% (5)
- D7% (2)
Community Discussion
11The correct answer is B. DatabaseMetaData is the interface that gives you information about the DBMS itself and the broader database, think driver version, supported SQL features, and table structure, while ResultSetMetaData is scoped only to the columns returned in a specific query result, so never confuse the two on exam day.
Good point on the scope distinction, and the one trap I fell into the first time was assuming getColumnCount() lived on DatabaseMetaData because it sounds like a "database" thing, but that method belongs to ResultSetMetaData since it counts columns in your result set, not in the table itself.
B is correct because DatabaseMetaData gives you information about the DBMS itself and the database, things like supported SQL features, table names, driver version, and connection info, while ResultSetMetaData is scoped to a specific query result and tells you about columns in that result set. People mix these up constantly because the names sound interchangeable, but they are not, they operate at completely different levels of abstraction.
Spun up a quick JDBC sandbox the night before, saw DatabaseMetaData pull DBMS info live, picked B without hesitation.
Wait, doesn't DatabaseMetaData cover the whole DBMS side, not ResultSet?
I was leaning toward A because ResultSetMetaData sounds like it would cover everything data-related, but the key word is "result set," which pins that interface to column-level info about query output only. DatabaseMetaData is what gives you the broader DBMS and database picture, which is exactly what option B says, and that distinction is worth burning into memory before exam day.
A swaps the name tags here, trust B on this one.
Spin up a quick lab with two interfaces and run show interfaces before and after the swap so you can see exactly which MAC address moves with each name.
My first instinct was C, because the phrasing "result set" stuck in my head and I conflated the two interfaces during review. What snapped me out of it was going back to the actual split in JDBC: ResultSetMetaData tells you about the columns in a specific result set, things like column count, name, and type, while DatabaseMetaData is the one that gives you broader information about the DBMS and the database itself, like supported SQL features, driver version, and available tables. Option D is the classic trap because it swaps the roles entirely, and A fails for the same reason. The card I made for this uses a simple cue: "ResultSet is narrow, Database is wide," and I schedule it on a 3-day interval because the swap confusion has a high re-emergence rate for me.
B is right, but do you understand why ResultSetMetaData only sees column-level info?
First attempt I flipped B and D because the names feel backwards until they click. DatabaseMetaData tells you about the database itself, ResultSetMetaData tells you about the columns in a result set. On my second sit I just asked, what am I describing, and the answer wrote itself. B every time.