JDBC Flashcards

1
Q

Which object has all capabilities of a WebRowSet object, in addition to SQL JOIN capabilities?

A

JoinRowSet

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which method was used to load database drivers before establishing a connection when using a JDBC version previous to JDBC 4?

A

Class.forName()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which concurrency option indicates that a result set should support updates?

A

CONCUR_UPDATABLE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which ResultSet method moves the cursor forward one row?

A

next

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which transaction isolation level option allows dirty, non-repeatable, and phantom reads?

A

TRANSACTION_READ_UNCOMMITTED

Defined in Connection.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which two standards must a database driver support to meet JDBC compliance?

A

JDBC API and SQL 92 Entry Level

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which resultSetType option indicates ResultSet object that is scrollable and generally sensitive to underlying changes to the data.

A

TYPE_SCROLL_SENSITIVE

Defined in ResultSet

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which transaction isolation level prevents dirty, non-repeatable, and phantom reads?

A

TRANSACTION_SERIALIZABLE

Defined in Connection.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Which transaction isolation level indicates that dirty reads and non-repeatable reads are prevented; phantom reads can occur?

A

TRANSACTION_REPEATABLE_READ

Defined in Connection.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which transaction isolation level indicates that dirty reads are prevented; non-repeatable reads and phantom reads can occur.

A

TRANSACTION_READ_COMMITTED

Defined in Connection.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which resultSetType option indicates ResultSet object that is scrollable but generally not sensitive to changes to the underlying data.

A

TYPE_SCROLL_INSENSITIVE

Defined in ResultSet.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which resultSetType option indicates ResultSet object whose cursor may move only forward.

A

TYPE_FORWARD_ONLY

Defined in ResultSet.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which isolation level applies an exclusive read/write lock for a query and only releases it after the transaction commits?

A

TRANSACTION_SERIALIZABLE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the connection string syntax for the Java DB Embedded Driver?

A

jdbc:derby:databaseName

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which object has all capabilities of a WebRowSet object, in addition to support for custom filters?

A

FilteredRowSet

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which three methods of the RowSetFactory create a RowSet object that supports XML read/write operations?

A

createFilteredRowSet, createJoinRowSet, and createWebRowSet

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Which Statement method should be invoked to execute SELECT queries?

A

executeQuery

18
Q

How does JDBC 4 differ from previous versions when it establishes a database connection?

A

JDBC 4 automatically loads suitable drivers based on the database connection URL

19
Q

Which two fields will create a scrollable ResultSet object?

A

TYPE_SCROLL_INSENSITIVE and TYPE_SCROLL_SENSITIVE

20
Q

Which object is a connected interface that provides a JavaBean view of a result set?

A

JdbcRowSet

21
Q

Which Statement method should be invoked to execute DML statement?

A

executeUpdate

22
Q

How do you establish a connection using using JDBC 4 drivers?

A

DriverManager.getConnection() and DataSource.getConnection()

23
Q

When is a Connection object closed if it is declared in a try-with-resources statement?

A

After the try block runs

24
Q

What is a phantom read?

A

(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.

25
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";
26
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.
27
Which class is the default implementation of the connected interface that provides a JavaBean view of a result set?
JdbcRowSetImp
28
Which two classes are used to create a connected RowSet object in Java 7?
RowSetProvider and RowSetFactory
29
Which isolation level applies an exclusive write lock for a query and only releases it after the transaction commits?
TRANSACTION_REPEATABLE_READ
30
Which Statement method should be invoked to execute UPDATE, INSERT, and DELETE queries?
executeUpdate
31
Which isolation level prevents dirty and non-repeatable reads, but allows phantom reads?
TRANSACTION_REPEATABLE_READ
32
Which isolation level does not use a shared or exclusive locking mechanism?
TRANSACTION_READ_UNCOMMITTED
33
When auto-commit mode is disabled, which action actually executes SQL statements?
Invoking the commit method.
34
Which ResultSet method should be invoked before accessing the first row?
next
35
Which Statement class represents a query that is compiled on the DBMS immediately, so that subsequent statements are executed without recompiling?
PreparedStatement
36
Which Statement class represents a stored procedure that is compiled on the DBMS?
CallableStatement
37
Which parameter type(s) are supported by a PreparedStatement object?
Input parameters only
38
What is the local connection string syntax for the Java DB Network Client Driv
jdbc:derby://localhost:port/databaseName
39
Which isolation level uses a shared locking mechanism that only prevents access to uncommitted values?
TRANSACTION_READ_COMMITTED
40
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
41
Is Savepoint an Interface, Abstract class, or Concrete class
Interface