No student devices needed. Know more
31 questions
What is the return type of executeUpdate() method?
byte
short
int
long
What is the return type of executeQuery() method?
int
ResultSet
array
none of the above
what is the package name of "Class"?
java.util
java.sql
java.lang
java.io
What is true about DriverManager class?
It is class from java.lang package
It is a class from java.sql package
It is a interface from java.sql package
It is a class from java.lang package
What is JDBC?
JDBC is a java based protocol.
JDBC is a standard Java API for database-independent connectivity between the Java programming language and a wide range of databases.
JDBC is a specification to tell how to connect to a database.
Joint Driver for Basic Connection
Which of the following encapsulates an SQL statement which is passed to the database to be parsed, compiled, planned and executed?
DriverManager
JDBC driver
Connection
Statement
Which of the following is not a valid type of statement in JDBC?
Statement
PreparedStatement
CallableStatement
QueryStatement
Which of the following is correct about PreparedStatement?
Used when you plan to use the SQL statements many times.
The PreparedStatement interface accepts input parameters at runtime.
Both of the above.
None of the above.
what is true about getConnection() method?
It is a static method from DriverManager class
It is a non static method from DriverManager class
It is a static method from DriverManager interface
It is a non static method from DriverManager interface
Which package contains JDBC classes and interfaces?
java.lang
java.io
java.sql
java.jdbc
Which statements about JDBC are true?
JDBC is an API to connect to relational-, object- and XML data sources
DBC stands for Java DataBase Connectivity
JDBC is an API to access relational databases, spreadsheets and flat files
JDBC is an API to bridge the object-relational mismatch between OO programs and relational databases
Which result set generally does not show changes to the underlying database that are made while it is open. The membership, order, and column values of rows are typically fixed when the result set is created?
TYPE_FORWARD_ONLY
TYPE_SCROLL_INSENSITIVE
TYPE_SCROLL_SENSITIVE
ALL MENTIONED ABOVE
Which method is used for an SQL statement that is executed frequently?
prepareStatement
prepareCall
createStatement
None of the above
Which packages contain the JDBC classes?
java.jdbc and javax.jdbc
. java.jdbc and java.jdbc.sql
java.sql and javax.sql
ava.rdb and javax.rdb
Which type of driver provides JDBC access via one or more ODBC drivers?
Type 1 driver
Type 2 driver
Type 3 driver
Type 4 driver
Which type of driver converts JDBC calls into the network protocol used by the database management system directly?
Type 1 driver
Type 2 driver
Type 3 driver
Type 4 driver
How can you retrieve information from a ResultSet?
By invoking the method get(…, String type) on the ResultSet, where type is the database type
By invoking the method get(…, Type type) on the ResultSet, where Type is an object which represents a database type
By invoking the method getValue(…), and cast the result to the desired Java type.
By invoking the special getter methods on the ResultSet: getString(…), getBoolean (…), getClob(…),…
How can you execute DML statements (i.e. insert, delete, update) in the database?
By making use of the InsertStatement, DeleteStatement or UpdateStatement classes
By invoking the execute(…) or executeUpdate(…) method of a normal Statement object or a sub-interface object thereof
By invoking the executeInsert(…), executeDelete(…) or executeUpdate(…) methods of the DataModificationStatement object
By making use of the execute(…) statement of the DataModificationStatement object
Which of the following methods are needed for loading a database driver in JDBC?
registerDriver() method
Class.forName()
Both A and B
getConnection()
How can you execute a stored procedure in the database?
Call method execute() on a CallableStatement object
Call method executeProcedure() on a Statement object
Call method execute() on a StoredProcedure object
Call method run() on a ProcedureCommand object
Which one of the following contains date information?
java.sql.TimeStamp
java.sql.Time
java.io.Time
java.io.TimeStamp
Which one of the following contains date information?
java.sql.TimeStamp
java.sql.Time
java.io.Time
java.io.TimeStamp
Which of the following encapsulates an SQL statement which is passed to the database to be parsed, compiled, planned and executed?
DriverManager
JDBC driver
Connection
Statement
Which of the following is correct about PreparedStatement?
Used when you plan to use the SQL statements many times.
The PreparedStatement interface accepts input parameters at runtime.
Both of the above.
None of the above.
What is the return type of executeUpdate() method?
byte
short
int
long
what is true about getConnection() method?
It is a static method from DriverManager class
It is a non static method from DriverManager class
It is a static method from DriverManager interface
It is a non static method from DriverManager interface
Which of the following contains both date and time?
a) java.io.date
b) java.sql.date
c) java.util.date
d) java.util.dateTime
2. Which of the following is advantage of using JDBC connection pool?
a) Slow performance
b) Using more memory
c) Using less memory
d) Better performance
What does setAutoCommit(false) do?
a) commits transaction after each query
b) explicitly commits transaction
c) does not commit transaction automatically after each query
d) never commits transaction
Which of the following is used to call stored procedure?
a) Statement
b) PreparedStatement
c) CallableStatment
d) CalledStatement
Which of the following is used to rollback a JDBC transaction?
a) rollback()
b) rollforward()
c) deleteTransaction()
d) RemoveTransaction()
Explore all questions with a free account