Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 68 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
68
Dung lượng
227,82 KB
Nội dung
0.0/ 5.0 Points Question of 20 The interface communicates with the database, either directly or thought another database specific driver ? A Statement B Connection C DirectManager D Driver Question of 20 Which java.sql class provides the getConnection() method? 5.0/ 5.0 Points A ResultSet 71 B Connection C DriverManager D Driver 5.0/ 5.0 Points Question of 20 Which java.sql class or interface is used to create the object that is necessary for calling stored procedures? A CallableStatement B Statement C ResultSet D PreparedStatement 5.0/ 5.0 Points Question of 20 If one intends to work with a ResultSet, which of these PreparedStatement methods will not work? A executeUpdate() B executeQuery() C execute() Question of 20 What is, in terms of JDBC, a DataSource 5.0/ 5.0 Points A A DataSource is a factory of connections to a physical data source B A DataSource is a registry point for JNDI-services C A DataSource is the basic service for managing a set of JDBC drivers D A DataSource is the Java representation of a physical data source Question of 20 The methods of what type of object can be used to move the cursor through a result set? ? A Statement B URL C Connection D ResultSet 0.0/ 5.0 Points Question of 20 Which of the following describes a JDBC type driver? 0.0/ 5.0 Points A JDBC-ODBC bridge plus ODBC driver B Native-API partly Java driver C Native-protocol pure Java driver D JDBC-Net pure Java driver Question of 20 Are prepared statements actually compiled 5.0/ 5.0 Points A Yes, they compiled B No, they are bound by the JDBC driver Question of 20 What is correct about DDL statements (create, grant, ) 5.0/ 5.0 Points A DDL statements are treated as normal SQL statements, and are executed by calling the execute() method on a Statement (or a sub interface thereof) object B DDL statements cannot be executed by making use of JDBC, you should use the native database tools for this C Support for DDL statements will be a feature of a future release of JDBC D To execute DDL statements, you have to install additional support files Question 10 of 20 5.0/ 5.0 Points A method that takes a Student object and writes it to the Student table in a database implements _ ? A ResultSetMetaData B connection pooling C OR mapping (object to relational) D init, destroy Question 11 of 20 What is the meaning of ResultSet.TYPE_SCROLL_INSENSITIVE 5.0/ 5.0 Points A This means that the ResultSet is sensitive to scrolling, but insensitive to changes made by others B This means that the Resultset is sensitive to scrolling, but insensitive to updates, i.e not updateable C The meaning depends on the type of data source, and the type and version of the driver you use with this data source D This means that the ResultSet is insensitive to scrolling Question 12 of 20 Which of following is wrong about CallableStatement 0.0/ 5.0 Points A The object of CallableStatement class can be created using Connection.createCallableStatement() method B The object of CallableStatement class can be created using Connection.prepareCall() method C This interface is used to execute SQL stored procedures D This extends PreparedStatement interface Question 13 of 20 Are ResultSets updateable 5.0/ 5.0 Points A Yes, but only if you indicate a concurrency strategy when executing the statement, and if the driver and database support this option B Yes, but only if you call the method openCursor() on the ResultSet, and if the driver and database support this option C No, ResultSets are never updateable You must explicitly execute DML statements (i.e.insert, delete and update) to change the data in the underlying database D Yes, but only if the ResultSet is an object of class UpdateableResultSet, and if the driver and database support this option Question 14 of 20 What statements are correct about positioned updates (i.e cursor updates) in ResultSets 5.0/ 5.0 Points A.Only scrollable updateable ResultSets can use this approach to change the data in the current row of a ResultSet B.The name of the cursor is specified by the setCursorName(String name) method the Statement object C.Using the cursor technique is currently the only possible way to change the data in the current row of a ResultSet D.Insert statements are only supported when using scrollable cursors Question 15 of 20 0.0/ 5.0 Points When the message “No Suitable Driver” occurs A When the type driver is used B When the user name, password and the database does not match C When the driver is not registered by Class.forname() method D When the JDBC database URL passed is not constructed properly Question 16 of 20 How is the forName() method of the "Class" class used with JDBC? 5.0/ 5.0 Points A To load a JDBC driver B To establish a database connection C To execute a SQL statementresses D To load a result set Question 17 of 20 How can you execute DML statements (i.e insert, delete, update) in the database 5.0/ 5.0 Points A By invoking the executeInsert( ), executeDelete( ) or executeUpdate( ) methods of the DataModificationStatement object B By invoking the execute( ) or executeUpdate( ) method of a normal Statement object or a sub-interface object thereof C By making use of the InsertStatement, DeleteStatement or UpdateStatement classes D By making use of the execute( ) statement of the DataModificationStatement object 5.0/ 5.0 Points Question 18 of 20 What a correct ordering of steps should be to using a updatable recordset to insert new customers into the Customer table A Prompt user for customer information B Call set methods for each column using customer information C Execute statement S3 selecting the Customer table, return result set R1 D Close S3 E Ask if more customers to add, if so go back to ""Prompt user"" F Close connection G Open connection to database H Close R1 I Create statement S3 using SCROLLABLE and UPDATABLE flags J Go to insert row of R1 K Call R1.insertRow A I_G_C_J_A_B_E_K_H_D_F B G_I_C_J_A_B_K_E_D_H_F C G_I_C_J_A_B_K_E_H_D_F D I_G_C_J_A_B_K_E_H_D_F 5.0/ 5.0 Points Question 19 of 20 Which of the following statements will delete all records from the Invoices table that have a value of in the InvoiceTotal field? String query = ""DELETE FROM Invoices "" + ""WHERE InvoiceTotal = ""; Statement statement = connection.createStatement(); A statement.deleteRows(query); B statement.delete(query); C statement.executeQuery(query); D statement.executeUpdate(query); Question 20 of 20 Which driver is called as thin-driver in JDBC 5.0/ 5.0 Points A Type-3 driver B Type-2 driver C Type-4 driver D Type-1 driver Question of 20 5.0/ 5.0 Points Are prepared statements actually compiled A Yes, they compiled B No, they are bound by the JDBC driver Question of 20 Which interface of the JDBC API executes pre-compiled SQL statements? A Resultset B Statement 5.0/ 5.0 Points C PreparedStatement Question of 20 5.0/ 5.0 Points Which java.sql class or interface is used to create a Statement object? ? A Connection B Driver C DriverManager D ResultSet Question of 20 How is the forName() method of the "Class" class used with JDBC? A To load a JDBC driver B To establish a database connection 5.0/ 5.0 Points C To execute a SQL statementresses D To load a result set Question of 20 0.0/ 5.0 Points A object is used to submit a query to a database ? A java.sql B Connection C dataset D Statement Question of 20 _ helps manage the connection between the Java program and the database ? A ResultSet 0.0/ 5.0 Points