English
Summary
Conclusions
JDBC gives explicit control over resources, SQL, and transactions. Parameterized queries separate data from syntax, a DAO separates persistence from the UI, and a short transaction protects a compound domain action. The following topics will use these contracts in JavaFX without moving SQL into a button handler.
Self-check questions
- Why doesn't PreparedStatement parameterize a table name?
- How does JDBC distinguish NULL from a numeric zero?
- Why is max(id) unsuitable for obtaining your own key?
- What happens to a PostgreSQL transaction after an SQL error?
- Who should manage commit if an operation uses two DAOs?
- Why are batch and transaction different concepts?