Home / CSE MCQs / JDBC ::

CSE MCQs :: JDBC

  1. Which of the following methods are needed for loading a database driver in JDBC?
  2. A.
    registerDriver() method
    B.
    Class.forName()
    C.
    Both A and B
    D.
    getConnection()

  3. What is, in terms of JDBC, a DataSource?
  4. A.
    A DataSource is the basic service for managing a set of JDBC drivers
    B.
    A DataSource is the Java representation of a physical data source
    C.
    A DataSource is a registry point for JNDI-services
    D.
    A DataSource is a factory of connections to a physical data source

  5. What is the disadvantage of Type-4 Native-Protocol Driver?
  6. A.
    At client side, a separate driver is needed for each database
    B.
    Type-4 driver is entirely written in Java
    C.
    The driver converts JDBC calls into vendor-specific database protocol
    D.
    It does not support to read MySQL data

  7. When the message "No Suitable Driver" occurs?
  8. 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