JDBC Flashcards
Which object has all capabilities of a WebRowSet object, in addition to SQL JOIN capabilities?
JoinRowSet
Which method was used to load database drivers before establishing a connection when using a JDBC version previous to JDBC 4?
Class.forName()
Which concurrency option indicates that a result set should support updates?
CONCUR_UPDATABLE
Which ResultSet method moves the cursor forward one row?
next
Which transaction isolation level option allows dirty, non-repeatable, and phantom reads?
TRANSACTION_READ_UNCOMMITTED
Defined in Connection.
Which two standards must a database driver support to meet JDBC compliance?
JDBC API and SQL 92 Entry Level
Which resultSetType option indicates ResultSet object that is scrollable and generally sensitive to underlying changes to the data.
TYPE_SCROLL_SENSITIVE
Defined in ResultSet
Which transaction isolation level prevents dirty, non-repeatable, and phantom reads?
TRANSACTION_SERIALIZABLE
Defined in Connection.
Which transaction isolation level indicates that dirty reads and non-repeatable reads are prevented; phantom reads can occur?
TRANSACTION_REPEATABLE_READ
Defined in Connection.
Which transaction isolation level indicates that dirty reads are prevented; non-repeatable reads and phantom reads can occur.
TRANSACTION_READ_COMMITTED
Defined in Connection.
Which resultSetType option indicates ResultSet object that is scrollable but generally not sensitive to changes to the underlying data.
TYPE_SCROLL_INSENSITIVE
Defined in ResultSet.
Which resultSetType option indicates ResultSet object whose cursor may move only forward.
TYPE_FORWARD_ONLY
Defined in ResultSet.
Which isolation level applies an exclusive read/write lock for a query and only releases it after the transaction commits?
TRANSACTION_SERIALIZABLE
What is the connection string syntax for the Java DB Embedded Driver?
jdbc:derby:databaseName
Which object has all capabilities of a WebRowSet object, in addition to support for custom filters?
FilteredRowSet
Which three methods of the RowSetFactory create a RowSet object that supports XML read/write operations?
createFilteredRowSet, createJoinRowSet, and createWebRowSet
Which Statement method should be invoked to execute SELECT queries?
executeQuery
How does JDBC 4 differ from previous versions when it establishes a database connection?
JDBC 4 automatically loads suitable drivers based on the database connection URL
Which two fields will create a scrollable ResultSet object?
TYPE_SCROLL_INSENSITIVE and TYPE_SCROLL_SENSITIVE
Which object is a connected interface that provides a JavaBean view of a result set?
JdbcRowSet
Which Statement method should be invoked to execute DML statement?
executeUpdate
How do you establish a connection using using JDBC 4 drivers?
DriverManager.getConnection() and DataSource.getConnection()
When is a Connection object closed if it is declared in a try-with-resources statement?
After the try block runs
What is a phantom read?
(Phantom reads) The situation that occurs when a transaction reads data it has previously read and finds new rows that were inserted by a committed transaction.
What is a dirty read?
A dirty read is when a value is read from the database that has not yet been committed. T1 writes value X; T2 reads value X; Since X is not committed, X is considered “dirty”;
What is a non-repeatable read?
A non-repeatable read occurs, when during the course of a transaction, a row is retrieved twice and the values within the row differ between reads.
Which class is the default implementation of the connected interface that provides a JavaBean view of a result set?
JdbcRowSetImp
Which two classes are used to create a connected RowSet object in Java 7?
RowSetProvider and RowSetFactory
Which isolation level applies an exclusive write lock for a query and only releases it after the transaction commits?
TRANSACTION_REPEATABLE_READ
Which Statement method should be invoked to execute UPDATE, INSERT, and DELETE queries?
executeUpdate
Which isolation level prevents dirty and non-repeatable reads, but allows phantom reads?
TRANSACTION_REPEATABLE_READ
Which isolation level does not use a shared or exclusive locking mechanism?
TRANSACTION_READ_UNCOMMITTED
When auto-commit mode is disabled, which action actually executes SQL statements?
Invoking the commit method.
Which ResultSet method should be invoked before accessing the first row?
next
Which Statement class represents a query that is compiled on the DBMS immediately, so that subsequent statements are executed without recompiling?
PreparedStatement
Which Statement class represents a stored procedure that is compiled on the DBMS?
CallableStatement
Which parameter type(s) are supported by a PreparedStatement object?
Input parameters only
What is the local connection string syntax for the Java DB Network Client Driv
jdbc:derby://localhost:port/databaseName
Which isolation level uses a shared locking mechanism that only prevents access to uncommitted values?
TRANSACTION_READ_COMMITTED
Which two fields are the default values for a ResultSet object? I.E. default concurrency level and ResultSet type.
CONCUR_READ_ONLY and TYPE_FORWARD_ONLY
Is Savepoint an Interface, Abstract class, or Concrete class
Interface