Flashcards

Quick study sessions to strengthen memory and retain key concepts.

Flashcard Study

Java: Transactions

Front

How can rollback() be used effectively in JDBC?

Rollback undoes all operations performed in a transaction if an error occurs. If an error arises partway through…

View Card →
Flashcard Study

Java: Transactions

Front

What role does commit() play in a JDBC transaction?

The commit() method permanently saves all SQL operations performed in a transaction. In a JDBC transaction, after executing…

View Card →
Flashcard Study

Java: Transactions

Front

Why should you disable auto-commit mode in JDBC?

Disabling auto-commit allows multiple operations to be grouped into a single transaction. When auto-commit is enabled, each SQL…

View Card →
Flashcard Study

Java: Transactions

Front

What should a checkout transaction usually represent?

The whole business operation that must succeed or fail together. Transactions are most useful when their scope matches…

View Card →
Flashcard Study

Java: ResultSets and Mapping

Front

How do you handle SQLExceptions when processing a ResultSet?

Use a try-catch block around ResultSet operations. Handle SQLExceptions by wrapping ResultSet operations in a try-catch block. This…

View Card →
Flashcard Study

Java: ResultSets and Mapping

Front

How would you explain a trade-off of using TYPE_SCROLL_INSENSITIVE ResultSet in an interview?

Results are not updated from the database. TYPE_SCROLL_INSENSITIVE does not reflect changes made to the database after the…

View Card →
Flashcard Study

Java: ResultSets and Mapping

Front

How can you iterate backwards through a ResultSet?

Use rs.previous() with a scrollable ResultSet. To iterate backwards, the ResultSet must be created with TYPE_SCROLL_INSENSITIVE or TYPE_SCROLL_SENSITIVE.…

View Card →
Flashcard Study

Java: ResultSets and Mapping

Front

What happens if a ResultSet column is missing in manual ORM?

Column access throws SQLException. Frame the concept in practical terms so you can explain it during interview discussion.…

View Card →
Flashcard Study

Java: ResultSets and Mapping

Front

How to extract a double value from a ResultSet?

Use rs.getDouble(columnLabel). Frame the concept in practical terms so you can explain it during interview discussion. To extract…

View Card →
Flashcard Study

Java: ResultSets and Mapping

Front

What are the implications of using ResultSet.TYPE_SCROLL_INSENSITIVE?

Allows cursor movement in both directions. ResultSet.TYPE_SCROLL_INSENSITIVE allows the cursor to move both forward and backward, making it…

View Card →