On This Page

This set of Advanced JAVA Multiple Choice Questions & Answers (MCQs) focuses on Advanced Java Set 1

Q1 | Which of the following contains both date and time?
  • java.io.date
  • java.sql.date
  • java.util.date
  • java.util.datetime
Q2 | Which one of the following contains date information?
  • java.sql.timestamp
  • java.sql.time
  • java.io.time
  • java.io.timestamp
Q3 | What does setAutoCommit(false) do?
  • commits transweraction after each query
  • explicitly commits transweraction
  • does not commit transweraction automatically after each query
  • never commits transweraction
Q4 | Which of the following is method of JDBC batch process?
  • setbatch()
  • deletebatch()
  • removebatch()
  • addbatch()
Q5 | Which of the following is used to rollback a JDBC trAnsweraction?
  • rollback()
  • rollforward()
  • deletetransweraction()
  • removetransweraction()
Q6 | Which driver uses ODBC driver to connect to the database?
  • jdbc-odbc bridge driver
  • native - api driver
  • network protocol driver
  • thin driver
Q7 | How many JDBC product components does the Java software provides?
  • 3
  • 2
  • 4
  • 5
Q8 | How many types of JDBC drivers are available?
  • 3
  • 4
  • 2
  • 5
Q9 | Which result set generally does not show changes to the underlying databasethat are made while it is open. The membership, order, and column values ofrows are typically fixed when the result set is created?
  • type_forward_only
  • type_scroll_insensitive
  • type_scroll_sensitive
  • all mentioned above
Q10 | Which method is used for an SQL statement that is executed frequently?
  • prepare statement
  • prepare call
  • create statement
  • none of the above
Q11 | What is used to execute parameterized query?
  • statement interface
  • preparedstatement interface
  • resultset interface
  • none of the above
Q12 | Which JDBC product components does the Java software provide?
  • the jdbc driver manager
  • the jdbc driver test suite
  • the jdbc-odbc bridge
  • all mentioned above
Q13 | JDBC stands for?
  • java database connectivity
  • java database concept
  • java database communications
  • none of the above
Q14 | Which of the following allows non repeatable read in JDBC Connection?
  • transweraction_read_uncommitted
  • transweraction_read_committed
  • transweraction_serializable
  • transweraction_repeatable_read
Q15 | Which of the following statements is false as far as different type ofstatements is concern in JDBC?
  • regular statement
  • prepared statement
  • callable statement
  • interim statement
Q16 | Which of the following methods are needed for loading a database driver inJDBC?
  • registerdriver() method
  • class.forname()
  • both a and b
  • getconnection()
Q17 | Which of the following is false as far as type 4 driver is concern?
  • type 4 driver is “native protocol, pure java” driver
  • type 4 drivers are 100% java compatible
  • type 4 drivers uses socket class to connect to the database
  • type 4 drivers can not be used with netscape
Q18 | Which driver is efficient and always preferable for using JDBC applications?
  • type – 4
  • type – 1
  • type – 3
  • type – 2
Q19 | JDBC facilitates to store the java objects by using which of the methods ofPreparedStatementsetObject () 2. setBlob() 3. setClob()
  • 1, 2
  • 1,2,3
  • 1,3
  • 2,3
Q20 | The JDBC-ODBC bridge is
  • three tiered
  • multithreaded
  • best for any platform
  • all of the above
Q21 | All raw data types (including binary documents or images) should be read anduploaded to the database as an array of
  • byte
  • int
  • boolean
  • char
Q22 | The class javA)sql.Timestamp has its super class as
  • java)sql.time
  • java)util.date
  • java)util.time
  • none of the above
Q23 | Which of the following is advantage of using JDBC connection pool?
  • slow performance
  • using more memory
  • using less memory
  • better performance
Q24 | Which of the following is advantage of using PreparedStatement in Java?
  • slow performance
  • encourages sql injection
  • prevents sql injection
  • more memory usage
Q25 | Which of the following is used to call stored procedure?
  • statement
  • preparedstatement
  • callablestatment
  • calledstatement