0 Points
Question 1 of 20
The ______ interface communicates with the database, either directly or thought another database specific
driver. ?
A. Statement
B. Connection
C. DirectManager
D. Driver
Question 2 of 20
Which java.sql class provides the getConnection() method?
A. ResultSet 71
B. Connection
C. DriverManager
D. Driver
Question 3 of 20
Which java.sql class or interface is used to create the object that is necessary for calling stored procedures?
A. CallableStatement
B. Statement
C. ResultSet
D. PreparedStatement
Question 4 of 20
If one intends to work with a ResultSet, which of these PreparedStatement methods will not work?
A. executeUpdate()
B. executeQuery()
C. execute()
Question 5 of 20
What is, in terms of JDBC, a DataSource
Question 6 of 20
The methods of what type of object can be used to move the cursor through a result set? ?
A. Statement
B. URL
C. Connection
D. ResultSet
Question 7 of 20
Which of the following describes a JDBC type 4 driver?
Question 8 of 20
Are prepared statements actually compiled
Question 9 of 20
What is correct about DDL statements (create, grant,...)
A. DDL statements are treated as normal SQL statements, and are executed by calling the
execute() method on a Statement (or a sub interface thereof) object
B. DDL statements cannot be executed by making use of JDBC, you should use the native
database tools for this.
C. Support for DDL statements will be a feature of a future release of JDBC
D. To execute DDL statements, you have to install additional support files
Question 10 of 20
A method that takes a Student object and writes it to the Student table in a database implements
___________. ?
A. ResultSetMetaData
B. connection pooling
C. OR mapping (object to relational)
D. init, destroy
Question 11 of 20
What is the meaning of ResultSet.TYPE_SCROLL_INSENSITIVE
A. This means that the ResultSet is sensitive to scrolling, but insensitive to changes made
by others
B. This means that the Resultset is sensitive to scrolling, but insensitive to updates, i.e. not
updateable
C. The meaning depends on the type of data source, and the type and version of the driver
you use with this data source
D. This means that the ResultSet is insensitive to scrolling
Question 12 of 20
Which of following is wrong about CallableStatement
Question 13 of 20
Are ResultSets updateable
A. Yes, but only if you indicate a concurrency strategy when executing the statement, and
if the driver and database support this option
B. Yes, but only if you call the method openCursor() on the ResultSet, and if the driver and
database support this option
C. No, ResultSets are never updateable. You must explicitly execute DML statements
(i.e.insert, delete and update) to change the data in the underlying database.
D. Yes, but only if the ResultSet is an object of class UpdateableResultSet, and if the driver
and database support this option
Question 14 of 20
What statements are correct about positioned updates (i.e. cursor updates) in ResultSets
A.Only scrollable updateable ResultSets can use this approach to change the data in the
current row of a ResultSet
B.The name of the cursor is specified by the setCursorName(String name) method the
Statement object.
C.Using the cursor technique is currently the only possible way to change the data in the
current row of a ResultSet
D.Insert statements are only supported when using scrollable cursors.
Question 15 of 20
Question 16 of 20
How is the forName() method of the "Class" class used with JDBC?
Question 17 of 20
How can you execute DML statements (i.e. insert, delete, update) in the database
Question 18 of 20
What a correct ordering of steps should be to using a updatable recordset to insert new customers into the
Customer table.
A. Prompt user for customer information
B. Call set methods for each column using customer information
C. Execute statement S3 selecting the Customer table, return result set R1
D. Close S3
E. Ask if more customers to add, if so go back to ""Prompt user""
F. Close connection
G. Open connection to database
H. Close R1
I. Create statement S3 using SCROLLABLE and UPDATABLE flags
J. Go to insert row of R1
K. Call R1.insertRow
A. I_G_C_J_A_B_E_K_H_D_F
B. G_I_C_J_A_B_K_E_D_H_F
C. G_I_C_J_A_B_K_E_H_D_F
D. I_G_C_J_A_B_K_E_H_D_F
Question 19 of 20
Which of the following statements will delete all records from the Invoices table that have a value of 0 in the
InvoiceTotal field?
String query = ""DELETE FROM Invoices "" + ""WHERE InvoiceTotal = 0 "";
Statement statement = connection.createStatement();
A. statement.deleteRows(query);
B. statement.delete(query);
C. statement.executeQuery(query);
D. statement.executeUpdate(query);
Question 20 of 20
Which driver is called as thin-driver in JDBC
A. Type-3 driver
B. Type-2 driver
C. Type-4 driver
D. Type-1 driver
Question 1 of 20
Question 2 of 20
Which interface of the JDBC API executes pre-compiled SQL statements?
A. Resultset
B. Statement
C. PreparedStatement
Question 3 of 20
A. Connection
B. Driver
C. DriverManager
D. ResultSet
Question 4 of 20
How is the forName() method of the "Class" class used with JDBC?
Question 5 of 20
A. java.sql
B. Connection.
C. dataset
D. Statement.
Question 6 of 20
_______ helps manage the connection between the Java program and the database. ?
A. ResultSet
B. Statement.
C. Connection.
D. java.sql
Question 7 of 20
What statements are correct about batched insert and updates? (2 correct answers)
Question 8 of 20
How can you execute DML statements (i.e. insert, delete, update) in the database
Question 9 of 20
A. Yes, but only if you indicate a concurrency strategy when executing the
statement, and if the driver and database support this option
B. Yes, but only if you call the method openCursor() on the ResultSet, and if the
driver and database support this option
C. No, ResultSets are never updateable. You must explicitly execute DML
statements (i.e.insert, delete and update) to change the data in the underlying
database.
D. Yes, but only if the ResultSet is an object of class UpdateableResultSet, and
if the driver and database support this option
Question 10 of 20
When you code an inner join in a SELECT statement you do not need to specify ?
A. an ORDER BY clause
Question 11 of 20
Which type of Statement can execute parameterized queries
A. ParameterizedStatement
C. PreparedStatement
Question 12 of 20
After a SELECT statement, a _________ is a logical table that's created temporarily within the database. ?
A. recordset
B. dataset
C. result set
D. datareader
Question 13 of 20
The result set retrieved by the following SELECT statement contains records that have
SELECT Balance, Num
FROM Accounts
WHERE Balance < 0
A. two fields from the Balance table where Account Num is less than 0
B. one field from the Balance table where Account Num is less than 0
C. two fields from the Accounts table where Balance is less than 0
D. all fields from the Accounts table where Balance is less than 0
Question 14 of 20
If one intends to work with a ResultSet, which of these PreparedStatement methods will not work?
A. executeUpdate()
B. executeQuery()
C. execute()
Question 15 of 20
Which of arguments are used by DriverManager.getConnection() (2 correct answers)
Question 16 of 20
Which of following is wrong about CallableStatement
Question 17 of 20
A. You will get a SQLException, because only Statement objects can close
ResultSets
B. The ResultSet, together with the Statement which created it and the
Connection from which the Statement was retrieved, will be closed and release all
database and JDBC resources
C. The method close() does not exist for a ResultSet. Only Connections can be
closed.
D. The database and JDBC resources are released
Question 18 of 20
Which driver is called as thin-driver in JDBC
A. Type-3 driver
B. Type-2 driver
C. Type-4 driver
D. Type-1 driver
Question 19 of 20
A. Dirty reads are prevented; non-repeatable reads and phantom reads can
occur
B. Dirty reads, non-repeatable reads and phantom reads can occur
C. Dirty reads and non-repeatable reads are prevented; phantom reads can
occur
D. Dirty reads, non-repeatable reads and phantom reads are prevented
Question 20 of 20
Which of the following describes a JDBC type 4 driver?
Question 1 of 20
What statements are correct about batched insert and updates? (2 correct
answers)
Question 2 of 20
Which java.sql class or interface is used to create the object that is necessary for
calling stored procedures?
A. CallableStatement
B. Statement
C. ResultSet
D. PreparedStatement
Question 3 of 20
A. 5
B. 4
C. 2
D. 3
Question 4 of 20
A method that takes a Student object and writes it to the Student table in a
database implements ___________. ?
A. ResultSetMetaData
B. connection pooling
D. init, destroy
Question 5 of 20
What statements are correct about positioned updates (i.e. cursor updates) in
ResultSets
A.Only scrollable updateable ResultSets can use this approach to change the
data in the current row of a ResultSet
B.The name of the cursor is specified by the setCursorName(String name)
method the Statement object.
C.Using the cursor technique is currently the only possible way to change the
data in the current row of a ResultSet
D.Insert statements are only supported when using scrollable cursors.
Question 6 of 20
A. ResultSet
B. JDBC
C. Command
D. Connection
Question 7 of 20
A. No
B. Yes
Question 8 of 20
Question 9 of 20
A. an INSERT statement
B. a configuration file
C. a SQL script
D. a LOAD command
Question 10 of 20
Question 11 of 20
How do you know in your Java program that a SQL warning is generated as a result
of executing a SQL statement in the database
A. You must catch the checked SQLException which is thrown by the method
which executes the statement
B. You must query the ResultSet object about possible warnings generated by
the database
C. You must invoke the getWarnings() method on the Statement object (or a
sub interface thereof)
D. You must catch the unchecked SQLWarningException which is thrown by the
method which executes the statement
Question 12 of 20
jdbc.drivers = sun.jdbc.odbc.JdbcOdbcDriver
The Above statement:
1. loads the JDBC-ODBC bridge drivers
2. unloads the JDBC-ODBC bridge drivers
C. 1 is true, 2 is false.
D. 1 is false, 2 is true.
Question 13 of 20
Which of the following methods finds the maximum number of connections that a
specific driver can obtain
A. DatabaseMetaData.getMaxConnections
B. Database.getMaxConnections
C. Connection.getMaxConnections
D. ResultSetMetaData.getMaxConnections
Question 14 of 20
A. Type-3 driver
B. Type-2 driver
C. Type-4 driver
D. Type-1 driver
Question 15 of 20
A. Result sets
D. SQL statements
Question 16 of 20
How can you execute DML statements (i.e. insert, delete, update) in the database
Question 17 of 20
Question 18 of 20
Which java.sql class or interface contains methods that enable you to find out the
number of columns this is returned in a ResultSet and the name or label for a given
column? ?
A. Statement
B. MetaData
C. CallableStatement
D. ResultSetMetaData
Question 19 of 20
When you code an inner join in a SELECT statement you do not need to specify ?
A. an ORDER BY clause
Question 20 of 20
Which driver is efficient and always preferable for using JDBC applications
A. Type 1
B. Type 2
C. Type 4
D. Type 3
A. Yes
B. No
Question 2 of 20
After a SELECT statement, a _________ is a logical table that's created temporarily within the database. ?
A. result set
B. datareader
C. recordset
D. dataset
Question 3 of 20
Question 4 of 20
Question 5 of 20
Which java.sql class or interface contains methods that enable you to find out the number of columns this is
returned in a ResultSet and the name or label for a given column? ?
A. Statement
B. MetaData
C. CallableStatement
D. ResultSetMetaData
Question 6 of 20
A. executeQuery()
B. executeResult()
C. executeUpdate()
D. execute()
A. The ResultSet, together with the Statement which created it and the
Connection from which the Statement was retrieved, will be closed and release all
database and JDBC resources
B. You will get a SQLException, because only Statement objects can close
ResultSets
C. The database and JDBC resources are released
D. The method close() does not exist for a ResultSet. Only Connections can be
closed.
Question 8 of 20
Which driver is called as thin-driver in JDBC
A. Type-2 driver
B. Type-3 driver
C. Type-4 driver
D. Type-1 driver
Question 9 of 20
A. The row you are positioned on is deleted from the ResultSet, but not from
the database.
B. The row you are positioned on is deleted from the ResultSet and from the
database
C. You will get a compile error: the method does not exist because you can not
delete rows from a ResultSet
D. The result depends on whether the property synchronizeWithDataSource is
set to true or false
Question 10 of 20
B. By invoking the method getValue(...), and cast the result to the desired Java
type.
C. By invoking the method get(..., Type type) on the ResultSet, where Type is
an object which represents a database type
D. By invoking the method get(..., String type) on the ResultSet, where type is
the database type
Question 11 of 20
A. Yes, but only if you indicate a concurrency strategy when executing the
statement, and if the driver and database support this option
B. Yes, but only if the ResultSet is an object of class UpdateableResultSet, and
if the driver and database support this option
C. Yes, but only if you call the method openCursor() on the ResultSet, and if the
driver and database support this option
D. No, ResultSets are never updateable. You must explicitly execute DML
statements (i.e.insert, delete and update) to change the data in the underlying
database.
Question 12 of 20
To improve the performance of database operations, an application can use _________ where a limited
number of connections are opened and are shared by users of the database. ?
A. ResultSetMetaData
C. init
D. connection pooling
Question 13 of 20
Which packages contain the JDBC classes
Question 14 of 20
Question 15 of 20
JDBC defines Java Classes for: ?
B. Result sets
D. SQL statements
Question 16 of 20
The methods of what type of object can be used to move the cursor through a result set? ?
A. ResultSet
B. Statement
C. URL
D. Connection
Question 17 of 20
The JDBC-ODBC bridge is
A. Three tiered
B. Multithreaded
Question 18 of 20
A. java.sql.Time
B. java.util.Date
C. java.util.Time
Question 19 of 20
Which of these operations are provided by DML Data Manipulation Language? ?
B. Creating table
Question 20 of 20
The _______ class is traditional management layer of JDBC, working between the user and the drivers
A. Connection
B. DriverManager
C. Resultset
the statement
(c) You must invoke the getWarnings() method on the
Statement object (or a sub interface thereof)
(d) You must query the ResultSet object about possible
warnings generated by the database
9. What is, in terms of JDBC, a DataSource?
(a) A DataSource is the basic service for managing a set
of JDBC drivers
(b) A DataSource is the Java representation of a physical
data source
(c) A DataSource is a registry point for JNDI-services
(d) A DataSource is a factory of connections to a physical
data source
10. What is the meaning of
ResultSet.TYPE_SCROLL_INSENSITIVE
(a) This means that the ResultSet is insensitive to
scrolling
(b) This means that the Resultset is sensitive to scrolling,
but insensitive to updates, i.e. not updateable
(c) This means that the ResultSet is sensitive to scrolling,
but insensitive to changes made by others
(d) The meaning depends on the type of data source, and
the type and version of the driver you use with this
data source
correct answers)
[a] Using the cursor technique is currently the only
possible way to change the data in the current row of a
ResultSet
[b] Insert statements are only supported when using
scrollable cursors.
[c] Only scrollable updateable ResultSets can use this
approach to change the data in the current row of a
ResultSet
[d] The name of the cursor is specified by the
setCursorName(String name) method the Statement
object.
16. How can you execute a stored procedure in the
database?
(a) Call method execute() on a CallableStatement object
(b) Call method executeProcedure() on a Statement object
(c) Call method execute() on a StoredProcedure object
(d) Call method run() on a ProcedureCommand object
17. What happens if you call the method close() on a
ResultSet object?
(a) the method close() does not exist for a ResultSet.
Only Connections can be closed.
(b) the database and JDBC resources are released
(c) you will get a SQLException, because only Statement
b. TRANSACTION_READ_COMMITTED
c. TRANSACTION_SERIALIZABLE
d. TRANSACTION_REPEATABLE_READ
23. Which of the following statements is false as far as
different type of statements is concern in JDBC?
a. Regular Statement
b. Prepared Statement
c. Callable Statement
d. Interim Statement
24. Which of the following methods are needed for loading
a database driver in JDBC?
a. registerDriver() method
b. Class.forName()
c. Both A and B
d. getConnection()
25. Which of the following is false as far as type 4 driver is
concern?
a. Type 4 driver is native protocol, pure java driver
b. Type 4 drivers are 100% Java compatible
c. Type 4 drivers uses Socket class to connect to the
database
d. Type 4 drivers can not be used with Netscape
a. 1, 2
b. 1,2,3
c. 1,3
d. 2,3
29. Which statement is static and synchronized in JDBC
API?
a. executeQuery()
b. executeUpdate()
c. getConnection()
d. prepareCall()
30. The JDBC-ODBC bridge is
a. Three tiered
b. Multithreaded
c. Best for any platform
d. All of the above
31. All raw data types (including binary documents or
images) should be read and uploaded to the database as
an array of
a. byte
b. int
c. boolean
d. char
JDBC?
a. execute()
b. executeQuery()
c. executeUpdate()
d. executeResult()
40. What is the disadvantage of Type-4 Native-Protocol
Driver?
a. At client side, a separate driver is needed for each
database.
b. Type-4 driver is entirely written in Java
c. The driver converts JDBC calls into vendor-specific
database protocol
d. It does not support to read MySQL data.
Part 1 of 1 -
Question 1 of 20
The ______ interface communicates with the database, either directly or thought
another database specific driver. ?
A. DirectManager
B. Driver
C. Statement
D. Connection
Question 2 of 20
C. Dirty reads are prevented; non-repeatable reads and phantom reads can
occur
D. Dirty reads and non-repeatable reads are prevented; phantom reads can
occur
Question 3 of 20
A. executeQuery()
B. execute()
C. executeUpdate()
Question 4 of 20
Question 5 of 20
A. ResultSetMetaData
C. init
D. connection pooling
Question 6 of 20
Question 8 of 20
How is the forName() method of the "Class" class used with JDBC?
Question 9 of 20
D. When the user name, password and the database does not match
Question 10 of 20
The methods of what type of object can be used to move the cursor through a
result set? ?
A. ResultSet
B. Statement
C. URL
D. Connection
Question 11 of 20
A. ResultSet 71
B. Connection
C. DriverManager
D. Driver
Question 12 of 20
A method that takes a Student object and writes it to the Student table in a
database implements ___________. ?
A. init, destroy
C. connection pooling
D. ResultSetMetaData
Question 13 of 20
All raw data types (including binary documents or images) should be read and
uploaded to the database as an array of
A. Boolean
B. int
C. byte
D. Char
Question 14 of 20
A. Regular Statement
B. Prepared Statement
C. Callable Statement
D. Interim Statement
Question 15 of 20
What statements are correct about positioned updates (i.e. cursor updates) in
ResultSets
A.Only scrollable updateable ResultSets can use this approach to change the
data in the current row of a ResultSet
B.Using the cursor technique is currently the only possible way to change the
data in the current row of a ResultSet
C.Insert statements are only supported when using scrollable cursors.
Question 16 of 20
What a correct ordering of steps should be to updating the Orders and the
Customers tables, all within the same transaction:
A. Commit
B. Close S1
C. execute S1
D. Create a statement S1 to update Orders
E. Create a statement S2 to update Customers
F. execute S2
G. Close connection
H. Close S2
I. Open connection to the database
J. Set auto commit to false
K. Set auto commit to true
A. I_D_E_C_J_F_A_B_H_K_G
B. I_D_E_J_C_F_A_B_H_K_G
C. I_E_D_J_C_F_A_B_H_K_G
D. I_D_E_J_C_F_A_B_H_G_K
Question 17 of 20
A. PreparedStatement
D. ParameterizedStatement
Question 18 of 20
Which of the following methods are needed for loading a database driver in JDBC
A. registerDriver() method
B. Both A and B
C. getConnection()
D. Class.forName()
A. SQL script
B. result set
C. connection
D. SQL statement
Question 20 of 20
A. JDBC
B. Connection
C. Command
D. ResultSet