1. Consider the following statement: PreparedStatement ps=con.prepareStatement('INSERT INTO ORDER (CUSTOMER_ID ,PRICE) VALUES(?,?)'); Which should come after this statement?
2. Which method eliminates the need to call wasNull() method to handle null database fields?
3. Which type of statement object will you use to execute a stored procedure?
4. You have to handle an erroneous situation in a transaction. Which method comes handy in this case?
5. 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?
6. Which JDBC methods is used for retrieving large binary objects?
7. A user leaves an online shopping cart without checking out. Which interfaces will notify to Rollback the transaction?
8. When you are handling user-submitted SQL, you may retrieve a ResultSet or a count. Which method is handy in this situation?
9. 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?
10. You want to execute the following query string, using the connection named 'con': String query = 'SELECT * FROM CUSTOMER'; What should the syntax be?
11. After executing the following code, resultvar contains false. What should the next step be? boolean resultvar=stmt.execute(sql);
12. Which is not true?
13. Which is the syntax for creating a CallableStatement?
14. 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?
15. Will the below script execute properly? 1.CREATE TABLE CUSTOMER 2.( 3.CUS_NAME VARCHAR(32), SUP_ID INTEGER, PRICE FLOAT, SALES INTEGER 4.)
16. How do you register a JDBC driver?
17. 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?
18. Name the interface you will use to retrieve the underlying structure of the query result:
19. You are developing a shopping cart for your client. Where would you like to put your business logic?
20. You want to start a transaction for bank account processing. Which method will you execute on the Connection object to begin it?
21. Which method will you use to execute INSERT, UPDATE and DELETE SQL statements?
22. What should the syntax be to establish a connection with a Database?
23. ResultSet objects follow index patterns of:
24. 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.absolute(-10); scrollrs.relative(-6); At which row number is the cursor currently located?
25. Your project leader has asked you to improve the performance of JDBC connectivity by reusing objects in your Servlet's code. Which is an appropriate solution?
26. Which is not true for a ResultSet?
27. You want to execute a CallableStatement named 'cs'. It is expected to return multiples results. Which of the following methods will you choose?
28. How will you create a new instance of a JDBC driver explicitly?
29. A process allows you to group multiple SQL statements. Commit or Rollback can be performed on the group together. This process is known as:
30. Which JDBC driver is considered best in terms of performance and efficiency?
31. Which exception will be thrown in your code, if the specified driver could not be loaded?
32. Please select all the correct options. JDBC Driver Manager is:
33. Java Database Connectivity (JDBC) is a:
34. 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?
35. SQLException has a method, which provides the feature of chaining or encapsulation of additional Exception objects. Identify the method from the following:
36. 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?
37. Under which category does the following driver fall: WebLogic's Tengah 'all Java Type-3 driver'
38. JDBC is based on:
39. SQLWarning object deals with database access warnings. It is a subclass of:
40. Open Database Connectivity is:
41. A warning can be thrown by a Connection object, a Statement object or a ResultSet object. Which method is used to retrieve the warning:
42. Transactions have a property called atomicity, which means:
43. Servlet developers should avoid using JDBC-ODBC bridge driver because:
44. ResultSet objects follow index patterns of:
45. Which method eliminates the need to call wasNull() method to handle null database fields?
46. Open Database Connectivity is:
47. A ______ RowSet object makes a connection to a data source only to read or write data based on a ResultSet object.
48. A transaction is finished when commit() or rollback() is called on the Transaction object.
49. Resources used by Blob, Clob an NClob Java objects can be released by using which method?
50. If your Java aplication is accessing multiple databases at the same time, the preferred driver type is:
51. General SQL escape syntax format is:
52. The list associated with a Statement object may contain a statement that produces a ResultSet object.
53. For storing file into the database, which datatype is used in table?
54. Applications may release Blob, Clob, and NClob resources by invoking their release method.
55. After fetching an instance of the Connection object, a live connection must first be established before making queries to the database.
56. The _______ of a ResultSet object determines what level of update functionality is supported.
57. Which is not an Advanced Data type in JDBC API?
58. MySQL and Java DB support the ARRAY SQL data type.
59. Which driver type is best suited for development and testing purpose?
60. _______ is NOT a valid example of a transaction isolation level.
61. The DATALINK SQL data type maps to the JDBC _____ object.
62. Which object has the ability to use input and output streams to supply parameter data?
63. A _______ is a set of one or more statements that is executed as a unit.
64. Which parameter is used by the Preparedstatement object?
65. If you are going to use Static SQL statements at runtime, the best JDBC interface to use is:
66. Transaction_read_committed (one example of transaction isolation level) does not alow:
67. _______ driver type is the JDBC-ODBC bridge?
68. _______ driver type(s) can be used in a three-tier architecture and if the web server and DBMS are running on the same machine.
69. _______ JDBC driver type(s) can be used in either applet or servlet code.
70. _______ driver type(s) are for use over communication networks.
71. JDBC is an API to connect object and XML data sources.
72. A _______ is used to access the data in a ResultSet.
73. ________ is NOT a step you must perform to process an SQL statement.
74. Autocommit must be set to false when using batch processing with Statement object?
75. In order to undo the previous transaction, use
76. The most common exception you'll deal with JDBC:
77. In the syntax {ts 'yyyy-mm-dd hh:mm:ss'}, ts stands for
78. Which package contains the JDBC classes?
79. You must register your JDBC driver in your program before using it?
80. JDBC will work with many different database management systems.
81. What kind of database is the command jdbc:mysql:://localhost:3306/ is connecting to?
82. JDBC stands for _______.
83. If a database operation fails, JDBC raises an:
84. In order to commit changes to the database, use:
85. The SQLXML interface provides the _____ method to access its internal content.
86. Which is NOT needed to set up a JDBC Environment:
87. A ______ object lets you access the data returned by an SQL statement.
88. If the ResultSet type is TYPE_FORWARD_ONLY, it implies:
89. The Class.forname() method is used to:
90. If the column you are interested in viewing contains an int, which of the following methods of Resultset can be used?
91. _______ extends the RowSet interface.
92. SQLWarning objects are a subclass of SQLException.
93. If executing a Statement object many times, a PreparedStement object will reduce execution time.
94. When a Driver Class is loaded, it creates an instance of itself and registers it with:
95. At the end of the JDBC program, it is explicity required to close al the connections to the database?
96. In the command jdbc:derby:testdb;create=true, testdb stands for
97. Which in not required by the getConnection() method to create a connecton object?
98. {fn length('Friday')} will return
99. In order to accept input parameters at runtime, use the following JDBC interface:
100. The default mode when a connection is created is auto-commit mode.
JSP and Servlets
LAMP
Linux
Microsoft MVC Framework
Microsoft SQL Server
Microsoft Silverlight
Related MCQ's
Popular MCQ's