Follow an exercise in managing exceptions in JDBC.
- [Instructor] Now throughout this course,…we haven't really been doing much error handling…with our SQL code.…We've just been catching it and converting it…to a very generic runtime exception,…put it in stack trace and throwing it out.…And that's essentially how many people…do JDBC code exceptions and I want to talk through…some very common patterns that you could leverage instead…that I think would make your code much cleaner.…Now first of all, why?…So as you can probably tell at this point,…error handling in JDBC can be a nightmare,…and if you don't manage it, it can get even worse.…
Everything is a SQLException, which I strongly dislike…because I can't really do any flow control…when everything's the same.…One thing I notice that it's not something to ignore,…so we kind of ignored it in our examples…and that was just because we didn't really…want to deal with it at that time.…But in the real world you need to deal with this,…and I'm going to give you a couple strategies.…The first strategy that you can deal with…
AuthorFrank P Moley III
- Deciphering JDBC terminology
- Using containerized PostgreSQL
- Creating, reading, updating, and deleting data
- The Repository pattern
- Using stored procedures
- Ordering and limiting results
- Transactions in JDBC
- Handling exceptions
Skill Level Intermediate
Database Foundations: Core Conceptswith Adam Wilbert2h 14m Beginner
Java Essential Training: Objects and APIswith David Gassner2h 46m Intermediate
What you need to know5m 10s
1. Introducing Java Data Access
2. Data Access Basics
3. Advanced Data Access
Next steps3m 26s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.