Top 250+ Solved Advanced JAVA MCQ Questions Answer
Q. Which of the following methods are needed for loading a database driver inJDBC?
a. registerdriver() method
b. class.forname()
c. both a and b
d. getconnection()
Q. Which of the following is false as far as type 4 driver is concern?
a. type 4 driver is “native protocol, pure java” driver
b. type 4 drivers are 100% java compatible
c. type 4 drivers uses socket class to connect to the database
d. type 4 drivers can not be used with netscape
Q. Which driver is efficient and always preferable for using JDBC applications?
a. type – 4
b. type – 1
c. type – 3
d. type – 2
Q. The JDBC-ODBC bridge is
a. three tiered
b. multithreaded
c. best for any platform
d. all of the above
Q. All raw data types (including binary documents or images) should be read anduploaded to the database as an array of
a. byte
b. int
c. boolean
d. char
Q. The class javA)sql.Timestamp has its super class as
a. java)sql.time
b. java)util.date
c. java)util.time
d. none of the above
Q. Which of the following is advantage of using JDBC connection pool?
a. slow performance
b. using more memory
c. using less memory
d. better performance
Q. Which of the following is advantage of using PreparedStatement in Java?
a. slow performance
b. encourages sql injection
c. prevents sql injection
d. more memory usage
Q. Which of the following is used to call stored procedure?
a. statement
b. preparedstatement
c. callablestatment
d. calledstatement
Q. BLOB, CLOB, ARRAY and REF type columns can be updated in
a. jdbc 1.0
b. jdbc 4.0
c. jdbc 2.0
d. jdbc 3.0
Q. Which of the following methods finds the maximum number of connectionsthat a specific driver can obtain?
a. database.getmaxconnections
b. connection.getmaxconnections
c. databasemetadata)getmaxconnections
d. resultsetmetadata)getmaxconnections
Q. When the message “No Suitable Driver” occurs?
a. when the driver is not registered by class.forname() method
b. when the user name, password and the database does not match
c. when the jdbc database url passed is not constructed properly
d. when the type 4 driver is used
Q. Which driver is called as thin-driver in JDBC?
a. type-4 driver
b. type-1 driver
c. type-3 driver
d. type-2 driver