Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Unit.5mcq[1]

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Unit : 05

Interacting with database


1) The following classes belong to which package: Connection management,
DatabaseAccess, Data Types, Database Metadata, Exceptions Warnings:
a) javax.sql
b) java.sql
c) javax.swing
d) None of the above

2) Which of the following classes/interface allows you to establish a connection to


database:
a) java.sql.Driver
b) java.sql.DriverManager *
c) java.sql.connection
d) All of the above

3) Which of the following classes/interface allows you to send SQL statement to


database forexecution and read the result:
a) java.sql.Statement *
b) java.sql.PreparedStatement
c) java.sql.ResultSet
d) All of the above

4) What is the description of java.sql.DriverManager?


a) This class provides the functionality necessary for managing one or
moredatabase drivers.
b) This is an interface that abstracts the vendor specific connection protocol
c) This class is used to discover properties required to obtain the connection
d) This interface abstracts most of the interaction with the database.

5) What is the description of java.sql.Driver?


a) This class provides the functionality necessary
for managing one or more databasedrivers.
b) This is an interface that abstracts the vendor specific connection protocol
c) This class is used to discover properties required to obtain the connection
d) This interface abstracts most of the interaction with the database

6) What is the description of java.sql.DriverPropertyInfo?a)


a) This class provides the functionality necessary for managing one or more
databasedrivers.
b) This is an interface that abstracts the vendor specific connection protocol
c) This class is used to discover properties required to obtain the connection
d) This interface abstracts most of the interaction with the database.
7) Following is/are the packages for JDBC
a) java.sql
b) javax.sql
c) Both a and b
d) None of the above

8) Which interface is included in Data Types


a) java.sql.Types
b) java.sql.Date
c) java.sql.Blob
d) All of the above *

9) Which interface comes under DatabaseMetadata?


a) java.sql.DatabaseMetadata
b) java.sql.ResultSetMetaData *
c) Java.sql.ParameterMetadata
d) All of the above

10) Using which classes and interfaces of javax.sql package we can establish and
manageconnection with the data source?
a) Only DataSource
b) DataSource and DataManager
c) DataSource and DriverManager
d) Only DriverManager

11) _____________ has an important role in JDBC Architechtrue


a) Driver *
b) SqlData
c) DriverManager
d) ResultSet
12) _____________ refers to the bridge driver (JDBC-ODBC Bridge)
a. Type-1 Driver
b. Type-2 Driver
c. Type-3 Driver
d. Type-4 Driver
13) _____________ refers to a partly java and partly native code driver
a. Type-1 Driver
b. Type-2 Driver *
c. Type-3 Driver
d. Type-4 Driver

14) Which of the following is not the component of 3-tier architecture of JDBC
a. DataSource Object
b. Java Application
c. Java API *
d. Database

15) The javax.sql provides ................................ implementations which are used in


building server-side applications
a) .JNDI-based lookup to access databases via logical names
b) Connection Pooling
c) Distributed transaction
d) The RowSet
e) all of the above

16) The javax.sql package is used to develop the client/server sided applications and
provide server sided extension facilities. State the statement is true or false
a) True
b) False

17) Using which classes and interfaces of javax.sql package we can establish and
manage connection with the data source?
a) Only DataSource
b) DataSource and DataManager
c) DataSource and DriverManager
d) Only DriverManager

18) Which method is invoked on the statement object by p-assing the SQL statements as
parameter.
a. getXXX()
b. setXXX()
c. executeXXX()
d. All of the Above

19) ......................... can be used to represent a precompiled query , which can be


executed multiple times.
a. Statement Interface
b. PreparedStatement Interface
c. CallableStatement Interface
d. PreparedStatement Class

20) The excute method ....................... while using the PreparedStatement objects.
a. takes nth number of parameters. *
b. takes only one parameters.
c. do no takes any parametrs.
d. none of the above.

21) In the three tier model the middle tier of the services acts as a mediator between
________________________ and _________________.
a) Java application and databases

b) Client and Server

c) Java application and client

d) Java application and server

22) JDBC is a --------------------- interface, which means that it is used to invoke SQL commands
directly.
a) high level

b) low level

c) middle level

d) top level

23) JDBC Stands for


a) Java Database Connection

b) Java Database Connectivity

24) JDBC-ODBC bridge product provide _________ access via ____________.


a) JDBC driver, JDBC drivers

b) ODBC drivers, JDBC driver

c) JDBC driver, ODBC drivers

d) None

25) Methods of ResultSet() throws ____________


a) IOException

b) Exception
c) DatabaseException

d) SQLException

26) Name the type number of driver belongs to JDBC ODBC Bridge driver?

a) Type 1
b) Type 2

c) Type 3

d) Type 4

27) Native API converts ___________into the __________ used by DBMS.


a) Native API calls,JDBC API

b) JDBC API, Native API calls

c) JDBC API, pure API calls

d) JDBC API, pure Java

28) Native – protocol pure Java converts ……….. in to the ………… used by DBMSs directly.
a) JDBC calls, network protocol

b) Native API calls,JDBC API

c) JDBC API, pure API call

d) JDBC API, Native API calls

29) ODBC Drivers are platform _______________


a) Dependent

b) Independent

c) Both a and b

d) None

30) ODBC requires configuring _______ which represents the target database.
a) Data String Name

b) Data Source Name

c) Domain Name

d) Database name

You might also like