Font size
Worksheets2ND QTR-QUIZ 4-JDBC Prepared Statements-12-1-2022
Total questions: 25
Worksheet time: 14mins
Remember, you need an SQL queries in order to execute either a query or an update.
TRUE
FALSE
A special kind of Java JDBC Statement object with some useful additional features.
JDBC PreparedStatement
JAVA PreparedStatement
JDBC Statement
JAVA Statement
What is JDBC stand for?
Java Datarecord Connection
Java Datastore Connectivity
Java Database Connectivity
Java Data Connection
What is API stand for?
Applied Parameter Interface
Application Parameter Interface
Applied Programming Interface
Application Programming Interface
PreparedStatement in Java is one of several ways to execute SQL queries.
TRUE
FALSE
Java provides___________ , ____________ and ____________ for executing queries.
(Choose your 3 answers from the choices)
Statement
QueryStatement
PreparedStatement
ExecuteStatement
CallableStatement
Used for general-purpose queries.
Stored Procedure Statement
Statement
PreparedStatement
SQL Statement
Used for executing a parametric query.
QueryStatement
PreparedStatement
CallableStatement
Statement
Used for executing Stored Procedures.
CallableStatement
PreparedStatement
SQLStatement
ProcedureStatement
The Java JDBC PreparedStatement primary features are:
(Choose your 3 answers from the choices)
Easy to insert parameters into the SQL statement.
Easy to reuse the PreparedStatement with new parameter values.
May increase performance of executed statements.
May Reuse of PreparedStatement by the JDBC driver.
Enables easier individual updates.
It takes time for a database to parse an PreparedStatement string, and create a query plan for it.
TRUE
FALSE
Analysis of how the database can execute the query in the most efficient way.
PreparedStatement plan
JDBC plan
Query plan
SQL plan
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.
TRUE
FALSE
By reusing an existing PreparedStatement you can reuse both the query parsing and sql plan for subsequent queries.
TRUE
FALSE
There are two levels of potential reuse for a PreparedStatement.
(Choose 2 answers from the choices)
Reuse of PreparedStatement by the JDBC driver.
Reuse of PreparedStatement by the database.
Enables easier batch updates.
May increase performance of executed statements.
the JDBC driver can cache PreparedStatement objects internally.
TRUE
FALSE
The query parsing and cache plan could potentially be reused across Java applications
TRUS
FALSE
A sub interface of Statement.
Statement interface
PreparedStatement interface
CallableStatement interface
QueryStatement interface
Used to execute parameterized query.
Statement
PreparedStatement
CallableStatement
ParameterStatement
Executes the query. It is used for create, drop, insert, update, delete
etc.
public void setInt(int paramIndex, int
value)
public void setString(int paramIndex, String value)
public ResultSet executeQuery()
public int executeUpdate()
PreparedStatement also supports function query.
TRUE
FALSE
One of the important methods of PreparedStatement interface.
public AccessQuery()
public ResultSet executeQuery()
public ResultSet UpdateQuery()
public InsertQuery()
You can use a Java JDBC PreparedStatement instead of a Statement.
TRUE
FALSE
PreparedStatement in Java is one of four ways to execute SQL queries using JDBC API.
TRUE
FALSE
Are following statemet is correct?
insert into tblcustomer (id,firstname,lastname,email,birthdate) values(2,'RICKY','Miles','ricky2@google.com','2001-12-10');
TRUE
FALSE
