MARATHAWADA MITRAMANDAL’S POLYTECHNIC, THERGAON, PUNE-33
Academic Year 2019-2020
Program: CO5I Course: Advanced Java Programming (22517) Course Co-ordinator: Mrs.Chavan P.P.
Unit V- Interacting with Database
Question Bank
Sr.
Question Option A Option B Option C Option D
No.
1 JDBC stands for__________ Java Database Connectivity Java Database Control Java Database Components None of these
JDBC is an API to bridge the
JDBC is an API to connect to JDBC is an API to access object-relational
JDBC stands for Java DataBase
2 Which statements about JDBC are true? relational-, object and relational databases, mismatch between OO
connectivity.
XML data sources. spreadsheets and flat files. programs and relational
databases.
3 Which packages contain the JDBC classes? java.jdbc and javax.jdbc java.jdbc and java.jdbc.sql java.sql and javax.sql java.rdb and javax.rdb
JDBC technology-based drivers generally fit into how many
4 4 3 2 5
categories?
Which type of driver provides JDBC access via one or more ODBC
5 Type 1 driver Type 2 driver Type 3 driver Type 4 driver
drivers?
Which type of driver converts JDBC calls into the network protocol
6 Type 1 driver Type 2 driver Type 3 driver Type 4 driver
used by the database management system directly?
7 Which type of driver of JDBC is called pure driver? Type 1 driver Type 2 driver Type 3 driver Type 4 driver
8 Which type of driver of JDBC is called partly Java Driver? Type 1 driver Type 2 driver Type 3 driver Type 4 driver
Which driver is efficient and always preferable for using JDBC
9 Type 1 driver Type 2 driver Type 3 driver Type 4 driver
applications?
10 The JDBC-ODBCbridge is__ . three tiered multithreaded best for any platform all of the above
11 Which driver is called as thin-driver in JDBC? Type 4 driver Type 1 driver Type 3 driver Type 2 driver
12 Which driver type of JDBC is used in either applet or servlet ? Type 1and 2 Type 1and 3 Type 3 and 4 Type 4 only
Type 4 driver is "native Type 4 drivers uses socket
Type 4 drivers are 100 %Java Type 4 drivers can not be
13 Which of the following is false as far as type 4 driver is concern ? protocol, pure java" class to connect to the
compatible used with Netscape.
driver database.
Which of the following JDBCdrivers is known , as a partially java
14 JDBC-ODBCbridge driver Native-API driver Network protocol driver Thin driver
driver?
15 Which class has strong support of the JDBC architecture? The JDBCdriver manager The JDBCdriver test suite The JDBC-ODBCbridge All of these.
Methods on the Methods on the
In order to transfer data between a database and an application Methods on the ResultSet
PreparedStatement class for CallableStatement class for
16 written in the Java programming language, the JDBC API provides class for retrieving SQL All of these.
sending Java types as SQL retrieving SQL OUT
'Wtm:hof these methods? SELECTresults as Java types.
statement parameters. parameters as Java types.
The JDBC API has always supported persistent storage of objects
17 defined in the Java programming language through the methods TRUE FALSE
getObject and setObject.
A DataSource is the basic A DataSource is the Java A DataSource is a factory of
A DataSource is a registry
18 What is, in terms of JDBC, a DataSource? service for managing a representation of a connections to a
point for JNDIservices.
set of JDBC drivers. physical data source. physical data source.
Which of the following describes the correct sequence of the steps
involved in making a connection with a database.
1. Loading the driver.
19 1,3,4,2 1,2,3,4 2,1,3,4 4,1,2,3
2. Process the results.
3. Making the connection with the database.
4. Executing the SQL statements.
Which of the following methods are needed for
20 registerDriver() method Class.forName() Both a and b getConnection()
loading a database driver in JDBC ?
21 Which type of statement can execute parameterized queries? PreparedStatement Parameterized Statement CallableStatement All of these.
22 What is used to execute parameterized query ? Statement interface PreparedStatement interface ResultSet interface None of the above
Which of the following encapsulates an SQL
23 statement which is passed to the database to be DriverManager JDBC Driver Connection Statement
parsed, compiled, planned and executed?
24 Which of the following is used to call a stored procedure? Statement PreparedStatement CallableStatment Called Statement
You will get a compile error:
The row you are positioned The row you are positioned The result depends on
The method does
on is deleted from the on is deleted from the whether the property
25 What happens if you call deleteRow() on a ResultSet object ? not exist because you can not
ResultSet, but not from the ResultSet and from the synchronize With DataSource
delete rows from
database. database. is set to true or false.
a ResultSet.
The JDBC-ODBC bridge supports multiple concurrent open
26 TRUE FALSE
statements per connection?
All raw data types (for instance-data for images should be read and
27 byte int boolean char
uploaded to the database as an array of _
No, they are bound by the
28 Are prepared statements actually compiled ? Yes, they compiled
JDBCdriver
When the driver is not When the user name, When the JOBCdatabase URL
When the type 4 driver is
29 When the message "No Suitable Driver" occurs? registered by Class.forname() password and the database passed is not constructed
used.
method. does not match. properly.
30 Database system compiles query when it is_. executed initialized prepared invoked
_ is an open source DBMS product that runs in window as well as
31 JSP/SQL MySQL Microsoft Access MS Access
Linux.
32 To execute a statement, we invoke method __ . executeUpdate method executeRel method executeStmt method executeConn method
Method on resultset that tests whether or not there remains at least
33 fetch method current method next method access method
one unfetched tuple in result set, is said to be _
The ResultSet.next method is used to move to the next row of the
34 TRUE FALSE
ResultSet, making it the current row.
35 ResultSet object can be moved forward only and it is updatable. TRUE FALSE
36 Which JDBC drivers will run your program ? The JDBC-ODBCbridge. The JDBCdriver manager. The JDBCdriver test suite None of the above.
JOBC is a Java API that is used to connect and execute query to the
37 TRUE FALSE
database.