JDBC 2.1 Test
A process allows you to group multiple SQL statements. Commit or Rollback can be performed on the group together. This process is known as:
A user leaves an online shopping cart without checking out. Which of following interfaces will notify to Rollback the transaction?
A warning can be thrown by a Connection object, a Statement object or a ResultSet object. Which method is used to retrieve the warning:
After executing the following code, resultvar contains false. What should the next step be? boolean resultvar=stmt.execute(sql);
Consider the following statement: PreparedStatement ps=con.prepareStatement("INSERT INTO ORDER (CUSTOMER_ID ,PRICE) VALUES(?,?)"); Which of the following should come after this statement?
How do you register a JDBC driver?
How will you create a new instance of a JDBC driver explicitly?
Java Database Connectivity (JDBC) is a:
JDBC is based on:
Name the interface you will use to retrieve the underlying structure of the query result:
Open Database Connectivity is:
Please select all the correct options. JDBC Driver Manager is:
ResultSet objects follow index patterns of:
Servlet developers should avoid using JDBC-ODBC bridge driver because:
SQLException has a method, which provides the feature of chaining or encapsulation of additional Exception objects. Identify the method from the following:
SQLWarning object deals with database access warnings. It is a subclass of:
The code segment below defines a query: String qry="SELECT CUS_NAME, PRICE FROM CUSTOMER"; Which of the following code snippets will create a scrollable ResultSet?
Transactions have a property called atomicity, which means:
Under which category does the following driver fall: WebLogic's Tengah "all Java Type-3 driver"
What should the syntax be to establish a connection with a Database?
When you are handling user-submitted SQL, you may retrieve a ResultSet or a count. Which of the following methods is handy in this situation?
Which exception will be thrown in your code, if the specified driver could not be loaded?
Which JDBC driver is considered best in terms of performance and efficiency?
Which of the following is not true for a ResultSet?
Which of the following is not true?
Which of the following is the syntax for creating a CallableStatement?
Which of the following JDBC methods is used for retrieving large binary objects?
Which of the following JDBC methods is used for retrieving large text strings?
Which of the following methods eliminates the need to call wasNull() method to handle null database fields?
Which of the following methods will you use to execute INSERT, UPDATE and DELETE SQL statements?
Which type of statement object will you use to execute a stored procedure?
Will the below script execute properly? 1.CREATE TABLE CUSTOMER 2.( 3.CUS_NAME VARCHAR(32), SUP_ID INTEGER, PRICE FLOAT, SALES INTEGER 4.)
You are developing a shopping cart for your client. Where would you like to put your business logic?
You are trying to connect to a database through JDBC. There is a problem with one of the methods immediately after the driver has been loaded. Which exception will be thrown?
You executed a query to retrieve 40 products from the database and obtained a scrollable ResultSet named 'scrollrs'. You started scrolling the ResultSet as follows: scrollrs.next(); scrollrs.absol...
You have obtained a ResultSet object named 'rs' after executing the following query: SELECT * FROM CUSTOMER Which loop can you use to return all the records in the ResultSet?
You have obtained a scrollable ResultSet named 'srs' by executing a query. Which of the following methods will you use to verify the position of the cursor?
You have to handle an erroneous situation in a transaction. Which method comes handy in this case?
You need to use a third party driver for establishing a connection with the database. The subprotocol is "webx" and the DSN is "webdsn". What is the syntax of the URL?
You want to execute a CallableStatement named 'cs'. It is expected to return multiples results. Which of the following methods will you choose?
You want to execute the following query string, using the connection named "con": String query = "SELECT * FROM CUSTOMER"; What should the syntax be?
You want to start a transaction for bank account processing. Which of the following methods will you execute on the Connection object to begin it?
Your project leader has asked you to improve the performance of JDBC connectivity by reusing objects in your Servlet's code. Which of the following is an appropriate solution?
Your project leader has given you a new task. You have to work on a module in which the transaction has to be extended across multiple page requests and multiple servlets. How will you implement this?