* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download - TutorialsPoint
Oracle Database wikipedia , lookup
Commitment ordering wikipedia , lookup
Microsoft SQL Server wikipedia , lookup
Microsoft Access wikipedia , lookup
Entity–attribute–value model wikipedia , lookup
Ingres (database) wikipedia , lookup
Extensible Storage Engine wikipedia , lookup
Functional Database Model wikipedia , lookup
Serializability wikipedia , lookup
Microsoft Jet Database Engine wikipedia , lookup
Open Database Connectivity wikipedia , lookup
Concurrency control wikipedia , lookup
Relational model wikipedia , lookup
Clusterpoint wikipedia , lookup
ContactPoint wikipedia , lookup
JDBC MOCK TEST Copyright © tutorialspoint.com http://www.tutorialspoint.com This section presents you various set of Mock Tests related to JDBC Framework. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself. JDBC MOCK TEST IV Q 1 - Which of the following is correct about Disconnected RowSet? A - A disconnected RowSet object is ad-hoc in nature. B - Whenever it requires retrieving data from the database, it establishes the connection and closes it upon finishing the required task. C - The data that is modified during disconnected state is updated after the connection is reestablished. D - All of the above. Q 2 - Which of the following is correct about Statement? A - Used for general-purpose access to your database. B - Useful when you are using static SQL statements at runtime. C - The Statement interface cannot accept parameters. D - All of the above. Q 3 - Which of the following is correct about PreparedStatement? A - Used when you plan to use the SQL statements many times. B - The PreparedStatement interface accepts input parameters at runtime. C - Both of the above. D - None of the above. Q 4 - Which of the following is correct about CallableStatement? A - Used when you want to access the database stored procedures. B - The CallableStatement interface can accept runtime input parameters. C - Both of the above. D - None of the above. Q 5 - Which of the following is first step to create a JDBC application? A - Import packages containing the JDBC classes needed for database programming. B - Register the JDBC driver, so that you can open a communications channel with the database. C - Open a connection using the DriverManager.getConnection method. D - Execute a query using an object of type Statement. Q 6 - Which of the following step establishes a connection with a database? A - Import packages containing the JDBC classes needed for database programming. B - Register the JDBC driver, so that you can open a communications channel with the database. C - Open a connection using the DriverManager.getConnection method. D - Execute a query using an object of type Statement. Q 7 - Which of the following step closes a connection with a database? A - Open a connection using the DriverManager.getConnection method. B - Execute a query using an object of type Statement. C - Extract data from result set using the appropriate ResultSet.getXXX method. D - Clean up the environment by closing all database resources relying on the JVM's garbage collection. Q 8 - Which isolation level prevents dirty read in JDBC, connection class? A - TRANSACTION_READ_COMMITTED B - TRANSACTION_NONE C - TRANSACTION_READ_UNCOMMITTED D - TRANSACTION_REPEATABLE_READ Q 9 - Which of the following method can be used to create a connection object? A - getConnectionStringurl, Stringuser, Stringpassword B - getConnectionStringurl C - getConnectionStringurl, Propertiesprop D - All of the above. Q 10 - What is the use of blob, clob datatypes in JDBC? A - These are used to store large amount of data into database like images, movie etc which are extremely large in size. B - These are used to store XML data. C - Both of the above. D - None of the above. Q 11 - Resultset is an interface, how does it support rs.Next? A - JDBC provides implementation of ResultSet & other interfaces, through the Driver. B - Every vendor of Database provides implementation of ResultSet & other interfaces, through the Driver. C - Both of the above. D - None of the above. Q 12 - Which of the following a valid type of RowSet objects? A - Connected B - Disconnected C - Both of the above. D - None of the above. Q 13 - A connected RowSet Object is permanent in nature. It doesn't terminate until the application is terminated. A - true B - false Q 14 - A disconnected RowSet object is ad-hoc in nature. Whenever it requires retrieving data from the database, it establishes the connection and closes it upon finishing the required task. A - true B - false Q 15 - Which of the following is true about 'dirty read'? A - In typical database transactions, say one transaction reads and changes the value while the second transaction reads the value before committing or rolling back by the first transaction. This reading process is called as 'dirty read'. B - There is always a chance that the first transaction might rollback the change which causes the second transaction reads an invalid value. C - Both of the above. D - None of the above. Q 16 - Which of the following is a Metadata interfaces of JDBC? A - DatabaseMetaData B - ResultSetMetaData C - Both of the above. D - None of the above. Q 17 - Which of the following is true about Metadata interfaces of JDBC? A - The meta data provides comprehensive information about the database as a whole. B - The implementation for these interfaces is implemented by database driver vendors to let users know the capabilities of a Database. C - Both of the above. D - None of the above. Q 18 - Which of the following is true about Hibernate? A - Hibernate is an Object-Relational Mapping tool. B - It maps Objects to relational data. C - Both of the above. D - None of the above. Q 19 - Which of the following is true about JNDI? A - The JNDI is an API to access different naming and directory services. B - You use it to access something stored in a directory or naming service without haveing to code specifically to that naming or directory service. C - JNDI stands for Java Naming and Directory Interface. D - All of the above. Q 20 - Which of the following is true about JDBC? A - The JDBC API is an API to access different relational databases. B - You use it to access relational databases without embedding a dependency on a specific database type in your code. C - JDBC stands for Java DataBase Connectivity. D - All of the above. Q 21 - Prepared statements are more secure because they use bind variables, which can prevent SQL injection attack. A - true B - false Q 22 - The JDBC API provides the abstraction and the JDBC drivers provide the implementation. A - true B - false Q 23 - New drivers can be plugged-in to the JDBC API without changing the client code. A - true B - false Q 24 - You can open only one Statement object per connection when you are using the JDBC-ODBC Bridge. A - true B - false Q 25 - What does the Class.forName " MyClass " do? A - Loads the class MyClass. B - Execute any static block code of MyClass. C - Returns an instance of MyClass. D - All of the above. ANSWER SHEET Question Number Answer Key 1 D 2 D 3 C 4 C 5 A 6 C 7 D 8 A 9 D 10 A 11 B 12 C 13 A 14 A 15 C 16 C 17 C 18 C 19 D 20 D 21 A 22 A 23 A 24 A 25 D Loading [MathJax]/jax/output/HTML-CSS/jax.js