Java JDBC Tutorial - Part 4: Deleting Data from a MySQL Database

Java JDBC Tutorial - Part 4: Deleting Data from a MySQL Database {Celebrity |Famous |}%title%{ Net Worth| Wealth| Profile}
YouTube Excerpt: NEED TO LEARN JAVA - 5 FREE JAVA VIDEO COURSES - CLICK HERE - https://goo.gl/7i95F8 --- View more videos on my "Java JDBC Tutorial" Playlist: http://goo.gl/crT4nS Closed-Captioning and English subtitles available. ---- In this video tutorial, you will learn how to delete data from a MySQL database using Java JDBC. Download the source code from here: - http://www.luv2code.com/?p=758 Please subscribe to my channel. http://goo.gl/EV6Kwv ---- Follow luv2code: Website: http://www.luv2code.com YouTube: http://goo.gl/EV6Kwv Twitter: http://goo.gl/ALMzLG Facebook: http://goo.gl/8pDRdA --- Join my mailing list: Get advance notice on new tutorials. Emails about 1 per week. - http://www.luv2code.com/joinlist --- Questions or problems? Post them in the comments section below. --- Want to suggest a video? Leave a comment below. I'm always looking for new video ideas. Let me know what video you'd like for me to create. --- Video Transcript Time - 00:00 Hello. In this video, you will learn how to use Java JDBC to delete data from a database. In regards to Prep Work, you must have a database installed. This demo will use MySQL. Time: 00:13 You also need to have the database driver configured. Again, we’ll use MySQL. If you need help on how to do this, then please look at my other video “Connecting to a MySQL Database with Java.” Time - 00:31 In this example, we will use the employees’ table. This table has columns for employee ID, last name, first name, and e-mail address. Let’s switch over to the MySQL tool so we can review the data. Time - 00:45 As you can see, we have the employees’ table in place. Make note of the entry for David Brown. We will delete this employee from the database. The SQL command that we’ll use to delete an employee is delete from employees where last_name=’Brown’; Time - 01:09 Let’s move and try development environment and get started. We’ll start with this main program, that’s going to have three variables for the user, password, and the connection information. The first thing we’ll do is we’ll get a connection to the database by saying DriverManager.getConnection, passing in the params. Next, we’ll create the statement using myConn.createStatement. Then we’ll define the SQL query string. In this case, delete from employees where last_name=’Brown’ Time - 01:43 Now, actually execute that SQL statement by saying executeUpdate and the database will return the number of rows affected. Also, I will print those out. Then finally, I’ll just print out “Delete complete.” so that we know that I’m done. Time - 02:01 Now, let’s run our application. I’ll right click; I’ll select “Run As”, “Java Application.” Now, let it execute. Now, it will print out the number of Rows affected and Delete complete. Now, let’s move over to our SQL Query tool and very the results. Time - 02:24 If you note here with the previous entry, we had a listing for a David Brown. I’ll refresh this Query, and now note that David Brown is gone. A Java Application was actually successful in deleting that entry. Time - 02:37 Great, so in summary, you learned how to use Java JDBC to delete data from a database. If you would like to download the source code, please visit luv2code.com.

NEED TO LEARN JAVA - 5 FREE JAVA VIDEO COURSES - CLICK HERE - https://goo.gl/7i95F8 --- View more videos on my "Java JDBC Tutorial" Playlist:...

Read Full Article 🔍

Curious about Java JDBC Tutorial - Part 4: Deleting Data From A MySQL Database's Color? Explore detailed estimates, income sources, and financial insights that reveal the full picture of their profile.

color style guide

Source ID: _KuFESrNgsQ

Category: color style guide

View Color Profile 🔓

Disclaimer: %niche_term% estimates are based on publicly available data, media reports, and financial analysis. Actual numbers may vary.

Sponsored
Sponsored
Sponsored