Home / CSE MCQs / JDBC ::

CSE MCQs :: JDBC

  1. What is not true of a Java bean?
  2. A.
    There are no public instance variables
    B.
    It may have many constructors as necessary
    C.
    All persistent values are accessed using getxxx and setxxx methods
    D.
    All of the above are true of a Java bean

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. What happens if you call deleteRow() on a ResultSet object?
  4. A.
    The row you are positioned on is deleted from the ResultSet, but not from the database
    B.
    The row you are positioned on is deleted from the ResultSet and from the database
    C.
    The result depends on whether the property synchronizeWithDataSource is set to true or false
    D.
    You will get a compile error: the method does not exist because you cannot delete rows from a ResultSet

    View Answer

    Workspace

    Discuss Discuss in Forum


  5. The method on the result set that tests whether or not there remains at least one unfetched tuple in the result set, is said to be
  6. A.
    Fetch method
    B.
    Current method
    C.
    Next method
    D.
    Access method

    View Answer

    Workspace

    Discuss Discuss in Forum


  7. Which of the following is an advantage of using PreparedStatement in Java?
  8. A.
    Slow performance
    B.
    Encourages SQL injection
    C.
    Prevents SQL injection
    D.
    More memory usage

    View Answer

    Workspace

    Discuss Discuss in Forum


  9. Which type of Statement can execute parameterized queries?
  10. A.
    PreparedStatement
    B.
    ParameterizedStatement
    C.
    ParameterizedStatement and CallableStatement
    D.
    All kinds of Statements (i.e. which implement a sub interface of Statement)

    View Answer

    Workspace

    Discuss Discuss in Forum


  11. Which of the following encapsulates an SQL statement which is passed to the database to be parsed, compiled, planned and executed?
  12. A.
    DriverManager
    B.
    JDBC driver
    C.
    Connection
    D.
    Statement

    View Answer

    Workspace

    Discuss Discuss in Forum


  13. Which of the following is used to call a stored procedure?
  14. A.
    Statement
    B.
    PreparedStatement
    C.
    CallableStatment
    D.
    CalledStatement

    View Answer

    Workspace

    Discuss Discuss in Forum


  15. How many copies of a JSP page can be in memory at a time?
  16. A.
    One
    B.
    Two
    C.
    Three
    D.
    Unlimited

    View Answer

    Workspace

    Discuss Discuss in Forum


  17. What is, in terms of JDBC, a DataSource?
  18. 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

    View Answer

    Workspace

    Discuss Discuss in Forum


  19. Who invented Java?
  20. A.
    Netscape
    B.
    Microsoft
    C.
    Sun
    D.
    None

    View Answer

    Workspace

    Discuss Discuss in Forum