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
Q

What is a dirty read?

A

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
Q

What is a non-repeatable read?

A

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
Q

Which class is the default implementation of the connected interface that provides a JavaBean view of a result set?

A

JdbcRowSetImp

28
Q

Which two classes are used to create a connected RowSet object in Java 7?

A

RowSetProvider and RowSetFactory

29
Q

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

A

TRANSACTION_REPEATABLE_READ

30
Q

Which Statement method should be invoked to execute UPDATE, INSERT, and DELETE queries?

A

executeUpdate

31
Q

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

A

TRANSACTION_REPEATABLE_READ

32
Q

Which isolation level does not use a shared or exclusive locking mechanism?

A

TRANSACTION_READ_UNCOMMITTED

33
Q

When auto-commit mode is disabled, which action actually executes SQL statements?

A

Invoking the commit method.

34
Q

Which ResultSet method should be invoked before accessing the first row?

A

next

35
Q

Which Statement class represents a query that is compiled on the DBMS immediately, so that subsequent statements are executed without recompiling?

A

PreparedStatement

36
Q

Which Statement class represents a stored procedure that is compiled on the DBMS?

A

CallableStatement

37
Q

Which parameter type(s) are supported by a PreparedStatement object?

A

Input parameters only

38
Q

What is the local connection string syntax for the Java DB Network Client Driv

A

jdbc:derby://localhost:port/databaseName

39
Q

Which isolation level uses a shared locking mechanism that only prevents access to uncommitted values?

A

TRANSACTION_READ_COMMITTED

40
Q

Which two fields are the default values for a ResultSet object? I.E. default concurrency level and ResultSet type.

A

CONCUR_READ_ONLY and TYPE_FORWARD_ONLY

41
Q

Is Savepoint an Interface, Abstract class, or Concrete class

A

Interface