Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Online Quiz On Unit 3&4

Total questions: 10

Worksheet time: 8mins

Name
Class
Date
1.

Which of the following methods is used to establish a connection with the database in JDBC?

a)

connect()

b)

openConnection()

c)

DriverManager.getConnection()

d)

getConnection()

2.

Which of the following is NOT a type of JDBC driver?

a)

Type-1 Driver

b)

Type-2 Driver

c)

Type-3 Driver

d)

Type-5 Driver

3.

What does the executeQuery() method in JDBC do?

a)

Executes SQL update commands like INSERT, UPDATE, or DELETE

b)

Executes a SQL SELECT statement

c)

Closes the connection to the database

d)

Executes any SQL statement, including creating or dropping tables

4.

Which interface is used to retrieve data from the database after executing a query?

a)

Statement

b)

ResultSet

c)

Connection

d)

PreparedStatement

5.

What is the purpose of the RMI Registry?

a)

It acts as a database for storing remote objects.

b)

It manages the remote method invocations.

c)

It allows clients to locate remote objects by name.

d)

It is used to create remote objects.

6.

What does a stub represent in RMI?

a)

It is an actual implementation of a remote object.

b)

It acts as a proxy on the client side to forward requests to the remote object.

c)

It manages the RMI Registry.

d)

It stores the remote object on the server side.

7.

Which method is used by the client to locate and obtain a reference to a remote object from the RMI Registry?

a)

Naming.lookup()

b)

Naming.rebind()

c)

Registry.getReference()

d)

Remote.lookup()

8.

Which of the following is true about Remote Method Invocation (RMI)?

a)

RMI allows communication between objects on the same JVM.

b)

RMI allows communication between objects on different JVMs.

c)

RMI is only used for database communication.

d)

RMI does not require a network connection.

9.

In RMI, which interface is implemented by the server to expose remote methods to the client?

a)

RemoteInterface

b)

Serializable

c)

Remote

d)

RMIObject

10.

In RMI, the server is responsible for:

a)

Binding the remote object to the RMI Registry.

b)

Looking up the remote object from the RMI Registry.

c)

Providing the client with a stub.

d)

Providing the skeleton to the client.