Follow an exercise in deleting data using JDBC.
- [Instructor] So now we're to the last step…of our CRUD operation, deleting data.…So let's jump into JDBC and see how to do this operation.…So I want you to jump back into your IDE…and once again, go to source main Java,…our base package and our customer DAO.…Once again, we're going to add a private static string.…This time we will call it delete…and it will be equal to the value,…delete from customer where customer ID = ?…Now we can scroll down to our delete method…and we will implement this as we've done so many times…with a try with resources so PreparedStatement…passing in the delete,…catch the exception,…and now we can implement the method.…
And this is a relatively simple one to implement.…Statement.setLong equal to our ID…and then we will simply call statement.execute…because we don't need a return type on this.…And all there is to our delete method.…So let's go back to our JDBC executor…and we're going to get rid of most of this stuff…and we're going to go actually implement a full routine.…
But before we do that,…
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
Programming Foundations: Databases (2015)with Simon Allardice3h 11m Intermediate
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.