JDBC - Java (MCQ) questions and answers

Dear Readers, Welcome to JDBC multiple choice questions and answers with explanation. These objective type JDBC questions are very important for campus placement test and job interviews. Specially developed for the Networking freshers and professionals, these model questions are asked in the online technical test and interview of many IT companies.

1)    In order to transfer data between a database and an application written in the Java programming language, the JDBC API provides which of these methods?

- Published on 19 Oct 15

a. Methods on the ResultSet class for retrieving SQL SELECT results as Java types.
b. Methods on the PreparedStatement class for sending Java types as SQL statement parameters.
c. Methods on the CallableStatement class for retrieving SQL OUT parameters as Java types.
d. All mentioned above
Answer  Explanation 

ANSWER: All mentioned above

Explanation:
No explanation is available for this question!


2)   The JDBC API has always supported persistent storage of objects defined in the Java programming language through the methods getObject and setObject.
- Published on 19 Oct 15

a. True
b. False
Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


3)   Which JDBC type represents a "single precision" floating point number that supports seven digits of mantissa?
- Published on 19 Oct 15

a. REAL
b. DOUBLE
c. FLOAT
d. INTEGER
Answer  Explanation 

ANSWER: REAL

Explanation:
No explanation is available for this question!


4)   Which method is used for retrieving streams of both ASCII and Unicode characters is new in the JDBC 2.0 core API?
- Published on 19 Oct 15

a. getCharacterStream
b. getBinaryStream
c. getAsciiStream
d. getUnicodeStream
Answer  Explanation 

ANSWER: getCharacterStream

Explanation:
No explanation is available for this question!


5)   How many Result sets available with the JDBC 2.0 core API?
- Published on 19 Oct 15

a. 2
b. 3
c. 4
d. 5
Answer  Explanation 

ANSWER: 3

Explanation:
No explanation is available for this question!


6)   Abbreviate the term UDA?
- Published on 19 Oct 15

a. Unified Data Access
b. Universal Data Access
c. Universal Digital Access
d. Uniform Data Access
Answer  Explanation 

ANSWER: Universal Data Access

Explanation:
No explanation is available for this question!


7)   The performance of the application will be faster if you use PreparedStatement interface because query is compiled only once.
- Published on 22 Jul 15

a. True
b. False
Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


8)   Which method Drops all changes made since the previous commit/rollback?
- Published on 22 Jul 15

a. public void rollback()
b. public void commit()
c. public void close()
d. public Statement createStatement()
Answer  Explanation 

ANSWER: public void rollback()

Explanation:
No explanation is available for this question!


9)   The intent is for JDBC drivers to implement nonscrollable result sets using the support provided by the underlying database systems.
- Published on 22 Jul 15

a. True
b. False
Answer  Explanation 

ANSWER: False

Explanation:
No explanation is available for this question!


10)   Which methods returns a stream that simply provides the raw bytes from the database without any conversion?
- Published on 22 Jul 15

a. getCharacterStream
b. getBinaryStream
c. getAsciiStream
d. getUnicodeStream
Answer  Explanation 

ANSWER: getBinaryStream

Explanation:
No explanation is available for this question!


1 2 3 4 5