NEW
Font size
WorksheetsJDBC
Total questions: 10
Worksheet time: 5mins
Which of the following method is static and synchronized in JDBC API?
getConnection()
prepareCall()
executeUpdate()
executeQuery()
What does setAutoCommit(false) do?
It will not commit transactions automatically after each query.
It explicitly commits the transaction.
It never commits the transactions.
It will commit transaction automatically after each query.
What is the output if the "demo" database exists and contains an empty "users" table?
0
nothing will be printed
The code does not compile.
The code compiles but throws an exception at runtime.
Which resources have their close() method called when this code runs?
No close() methods are called.
Only Statement
Only Statement and Connection
both Statement and ResultSet
How many rows are added to the colors table from running the following?
None
One
Two
Three
The JDBC-ODBC bridge supports multiple concurrent open statements per condition?
True
False
Which methods are required to load a database driver in JDBC?
a. getConnection()
b. registerDriver()
c. forName()
d. Both b and c
e. both a and c
What is the correct sequence to create a database connection?
i. Import JDBC packages.
ii. Open a connection to the database.
iii. Load and register the JDBC driver.
iv. Execute the statement object and return a query resultset.
v. Create a statement object to perform a query.
vi. Close the resultset and statement objects.
vii. Process the resultset.
viii. Close the connection.
i, ii, iii, v, iv, vii, viii, vi
i, iii, ii, v, iv, vii, vi, viii
ii, i, iii, iv, viii, vii, v, vi
i, iii, ii, iv, v, vi, vii, viii
Which of the following driver is the fastest one?
JDBC-ODBC Bridge Driver
Native API Partly Java Driver
Network Protocol Driver
JDBC Net Pure Java Driver
How many statement objects can be created using a Connection?
only one
more than one
three
two
