Dbsj - Test Java For Aptech

65 Questions | Total Attempts: 1473

SettingsSettingsSettings
Please wait...
Java Quizzes & Trivia

Working with Database and Security in Java


Questions and Answers
  • 1. 
    Driver types are used to categorize the technology used to connect to the database.
    • A. 

      True

    • B. 

      False

  • 2. 
    This is an Application Programming Interface provided by Microsoft for access the database.It uses SQL as its database language.
    • A. 

      JDBC

    • B. 

      ODBC

  • 3. 
    JDBC is ODBC translated into an object-oriented interface that is natural for java programmiers.
    • A. 

      True

    • B. 

      False

  • 4. 
    In this Data processing Model,the client communicates directly to the database server without the help  of any middle-ware technologies or another server.
    • A. 

      Two-tier Data processing Model

    • B. 

      Three - tier Data processing Model

  • 5. 
    The Type 1 driver is also known as JDBC-ODBC bridge plus ODBC driver.
    • A. 

      Translates JDBC calls into ODBC calls.

    • B. 

      Translates JDBC calls into database=specific calls or native calls

    • C. 

      Maps JDBC calls to the underlying "network" protocol, which in turn calls native methods on the server.

    • D. 

      Directly calls RDBMS from client machine.

  • 6. 
    This method is use to execute any SQL statement with a "SELECT" clause, that return the result of the query as a result set.
    • A. 

      ExecuteUpdate();

    • B. 

      ExecuteQuery();

    • C. 

      Execute();

  • 7. 
    This method is used to execute INSERT, DELETE, UPDATE , and other SQL DDL such as CREATE, DROP Table.
    • A. 

      ExecuteUpdate();

    • B. 

      Execute();

    • C. 

      ExecuteQuery();

  • 8. 
    This method is used for retrieving a string value (SQL type VARCHAR) and assigning into java String object.
    • A. 

      GetVarchar();

    • B. 

      GetObject();

    • C. 

      GetString();

  • 9. 
    This method is used for retrieving the value from current row as object.
    • A. 

      GetRow();

    • B. 

      GetObject();

    • C. 

      GetString();

  • 10. 
    A client application uses stored procedures increases the network traffic, but it reduces the number of times a database is accessed.
    • A. 

      True

    • B. 

      False

  • 11. 
    This parameter is used to pass values into a  store procedure.The value pf this parameter cannot changed or reassigned within the module and hence is constant.
    • A. 

      IN

    • B. 

      OUT

    • C. 

      IN/OUT

  • 12. 
    OUT Parameter.- 3 choices.
    • A. 

      Pass out of procedure module.

    • B. 

      Is a constant

    • C. 

      Is a variable

    • D. 

      Back to the calling block

  • 13. 
    This Parameter behaves like an initialized variable.
    • A. 

      OUT

    • B. 

      IN

    • C. 

      IN/OUT

  • 14. 
    This object does not contain the stored procedure itself but contains only a call to the stored procedure.
    • A. 

      CallableStatment

    • B. 

      PreparedStatment

    • C. 

      PrepareCall();

  • 15. 
    It reefers to the ability to move backward as well as forward through a result set.
    • A. 

      Scrollable

    • B. 

      Updatable

    • C. 

      Holdable

  • 16. 
    This refers to the ability to check whether the cursor stays open after a COMMIT.
    • A. 

      Updatable

    • B. 

      Holdable

    • C. 

      Scrollable

  • 17. 
    The prepareStatment() method sends SQL query to the database. and this returns:
    • A. 

      PrepareStatment Object

    • B. 

      Callalbalestatment Object

    • C. 

      PrepareCall () method.

  • 18. 
    The CallableStatment object contains the SQL statments.
    • A. 

      True

    • B. 

      False

  • 19. 
    A cursor that can only be used to process from the beginning of a  ResultSet to the end of it.It is default type.
    • A. 

      TYPE_SCROLL_SENSITIVE

    • B. 

      TYPE_SCROLL_INSENSITIVE

    • C. 

      TYPE_FORWARD_ONLY

  • 20. 
    A Rowset Object provides scrollability and updatabilitu for any kind of DBMS or drivers.
    • A. 

      True

    • B. 

      False

  • 21. 
    A ResultSet object contains a set of rows from a result set or some other source of tabular data, like a file or spreadsheet.
    • A. 

      True

    • B. 

      False

  • 22. 
    Which class is a disconnected rowset.
    • A. 

      A CachedRowSet class.

    • B. 

      A JDBCRowSet class.

    • C. 

      A WebRowSet class.

  • 23. 
    This object connects to a data source only to read data from a ResultSet or write data back to the data source.
    • A. 

      A connected RowSet.

    • B. 

      A Disconnected RowSet.

  • 24. 
    Which statments are true?
    • A. 

      A RowSet has to be make scrollable and updatable at the time of creation.

    • B. 

      Scrollability and Updatability of a RowSet is independent of the JDBC driver

    • C. 

      A connect RowSet can read data from a non relational database source also.

    • D. 

      A RowSet is a JavaBeans component which has to programmatically notify all registered event listener.

  • 25. 
    The Result Set can not be modified and hence, It is not updatable in any way.
    • A. 

      CONCURENT_READ_ONLY

    • B. 

      CONCURENT_UPDATABLE