Home > Java > body text

_______ objects are used to execute static SQL statements and obtain their results.

WBOY
Release: 2024-02-22 13:00:23
forward
871 people have browsed it

php editor Strawberry brings you an article about Java Q&A. In Java, _________ objects are used to execute static SQL statements and obtain the results they produce. This article will answer this question for you and help you better understand the relevant knowledge points in Java programming. Let’s explore this topic together and improve your skills in the field of Java!

Question content

_______ object is used to execute static SQL statements and obtain their results.

  • a) Statement
  • b) Database
  • c) Result set
  • d) sql

According to me the correct answers are "statement" and "result set", but when I argued to sir that both of these are correct answers, he denied this and said that the only correct answer is "statement". Can someone give a proper explanation why they are both correct, the answer should be SQL since it has both Statement and Resultset.

Solution

ResultSet Does not execute the SQL statement. there has never been.

Statement.execute() Called to execute the SQL statement and return ResultSet. therefore:

  • It executes the SQL statement, and
  • It gets the result in the form of ResultSet.

So if you need to choose one of these four options:

  • a) Statement is the correct answer; see above.
  • c) ResultSet is not the correct answer; see above.
  • b) and d) are not correct answers because there is no such thing as "sql object" or "db object" in the JDBC model.

And Statement ResultSet is not an option. If this were an option, it would also (arguably) be correct.

In short, "Sir" is correct and you are wrong. Just accept it.

The above is the detailed content of _______ objects are used to execute static SQL statements and obtain their results.. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:stackoverflow.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template