wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

2ND QTR-QUIZ 4-JDBC Prepared Statements-12-1-2022

Total questions: 25

Worksheet time: 14mins

Name
Class
Date
1.

Remember, you need an SQL queries in order to execute either a query or an update.

a)

TRUE

b)

FALSE

2.

A special kind of Java JDBC Statement object with  some  useful  additional  features.  

a)

JDBC PreparedStatement

b)

JAVA PreparedStatement

c)

JDBC Statement

d)

JAVA Statement

3.

What is JDBC stand for?

a)

Java Datarecord Connection

b)

Java Datastore Connectivity

c)

Java Database Connectivity

d)

Java Data Connection

4.

What is API stand for?

a)

Applied Parameter Interface

b)

Application Parameter Interface

c)

Applied Programming Interface

d)

Application Programming Interface

5.

PreparedStatement in Java is one of several ways to execute SQL queries.

a)

TRUE

b)

FALSE

6.

Java provides___________ , ____________ and ____________ for executing queries.

(Choose your 3 answers from the choices)

a)

Statement

b)

QueryStatement

c)

PreparedStatement

d)

ExecuteStatement

e)

CallableStatement

7.

Used for general-purpose queries.

a)

Stored Procedure Statement

b)

Statement

c)

PreparedStatement

d)

SQL Statement

8.

Used for executing a parametric query.

a)

QueryStatement

b)

PreparedStatement

c)

CallableStatement

d)

Statement

9.

Used for executing Stored Procedures.

a)

CallableStatement

b)

PreparedStatement

c)

SQLStatement

d)

ProcedureStatement

10.

The Java JDBC PreparedStatement primary features are:

(Choose your 3 answers from the choices)

a)

Easy to insert parameters into the SQL statement.

b)

Easy to reuse the PreparedStatement with new parameter values.

c)

May increase performance of executed statements.

d)

May Reuse of PreparedStatement by the JDBC driver.

e)

Enables easier individual updates.

11.

It takes time for a database to parse an PreparedStatement string, and create a query plan for it.

a)

TRUE

b)

FALSE

12.

Analysis of how the database can execute the query in the most efficient way.

a)

PreparedStatement plan

b)

JDBC plan

c)

Query plan

d)

SQL plan

13.

If you submit a new, full SQL statement for every query or update to the database, the database has to parse the SQL and for queries create a query plan.

a)

TRUE

b)

FALSE

14.

By reusing  an existing PreparedStatement you can reuse both the query parsing and sql plan for subsequent queries.

a)

TRUE

b)

FALSE

15.

There are two levels of potential reuse for a PreparedStatement.

(Choose 2 answers from the choices)

a)

Reuse of PreparedStatement by the JDBC driver.

b)

Reuse of PreparedStatement by the database.

c)

Enables easier batch updates.

d)

May increase performance of executed statements.

16.

the JDBC driver can cache PreparedStatement objects internally.

a)

TRUE

b)

FALSE

17.

The query parsing and cache plan could potentially be reused across Java applications

a)

TRUS

b)

FALSE

18.

A sub interface of Statement.

a)

Statement interface

b)

PreparedStatement interface

c)

CallableStatement interface

d)

QueryStatement interface

19.

Used to execute parameterized query.

a)

Statement

b)

PreparedStatement

c)

CallableStatement

d)

ParameterStatement

20.

Executes the query. It is used for create, drop, insert, update, delete

etc.

a)

public void setInt(int paramIndex, int

value)

b)

public void setString(int paramIndex, String value)

c)

public ResultSet executeQuery()

d)

public int executeUpdate()

21.

PreparedStatement also supports function query.

a)

TRUE

b)

FALSE

22.

One of the important methods of PreparedStatement interface.

a)

public AccessQuery()

b)

public ResultSet executeQuery()

c)

public ResultSet UpdateQuery()

d)

public InsertQuery()

23.

You can use a Java JDBC PreparedStatement instead of a Statement.

a)

TRUE

b)

FALSE

24.

PreparedStatement in Java is one of four ways to execute SQL queries using JDBC API.

a)

TRUE

b)

FALSE

25.

Are following statemet is correct?

insert into tblcustomer (id,firstname,lastname,email,birthdate) values(2,'RICKY','Miles','ricky2@google.com','2001-12-10');

a)

TRUE

b)

FALSE