vTomb Logo

Java JDBC Tutorial - Part 6.1: Calling MySQL Stored Procedures with Java Video

Home
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

Download Java Source Code: http://www.luv2code.com/?p=1012

Closed-Captioning and English subtitles available.

Please SUBSCRIBE to this channel: http://goo.gl/EV6Kwv

---

In this video we will learn how to call MySQL Stored Procedures with Java.

----

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.

---

Transcript

Time - 00:00
Hi, this is Chad (Shod) with luv2code.com. Welcome back to another tutorial on Java JDBC. In this video, we’ll learn how to use stored procedures. We’ll first define what stored procedures are, next we’ll use callable statements. Then we’ll learn how to pass parameters to stored procedures. I’ll actually break this up over 4 different videos. I’ll show each parameter type in a separate video, so in this section we’ll cover IN parameters and then in the follow on sections, I’ll cover IN OUT, OUT and also result sets. Please stay tuned and check out the following videos for this.

Time - 00:39
A stored procedure is a group of SQL statements that perform a particular task. They are normally created by a DBA. The stored procedures are created in a SQL language that supported by the native database. Each database has its own language. For example, MySQL has stored procedures language, Oracle uses PL/SQL and Microsoft SQL Server uses Transact SQL. Finally, the stored procedures can also have any combination of input and output parameters. For this tutorial, we’ll use the following table employees. The table has sample data for testing. I have a SQL zip file that’s you can download. It will create the table, add sample data and also set up the stored procedures. You can download it from the link below.

Time - 01:22
All right, let’s go and switch over to the MySQL workbench and what I’m going to do is open up that SQL file and run it. This is our JDBC stored procedures directory. I have a subdirectory called SQL, and has this file, table set up that SQL. I’ll open this file, what this file does it basically creates a table as we see here and then it goes through and inserts a lot of sample data. Then, it also goes through and creates all of the stored procedures that we need for this tutorial, right. I’ll just go ahead and select execute and this will run and so now should I have a new table over here called employees and this table also has a collection or this database has a collection of stored procedures for this tutorial series, so get count employees, greet and increase salaries and we’ll go through all these stored procedures during the actual tutorial itself.

Time - 02:24
In JDBC, you make use of callable statements to make a call to the stored procedures. There is a special syntax to call stored procedures. You make use of curly braces inside of the string. You also make use of the JDBC keyword call and that’s followed by the name of the stored procedure. In this example, we’re not passing any params, so we’ll just use the open and closed parentheses. Finally, we execute the stored procedure. Let’s talk about the parameters on the next slide. The JDBC API support different types of parameters. You can make use of the IN parameter, INOUT and also the OUT. The stored procedures can also return a result set, during the code examples in this video, I’ll show you how to register different parameters types and also values.

Time - 03:09
Let’s start with IN parameters. For this parameter, we’re only passing an input parameter and the parameter is read-only. Our DBA has created a stored procedure on the database. This stored procedure will increase the salary for everyone in the department, which is kind of cool. The procedure takes two parameters. The first parameter is the department name. The second parameter is the increase amount. For example, we can call this stored procedure and increase the salaries of employees in the engineering department by $10,000. In terms of Java coding, we need to make a call to the stored procedure. First, we prepare a callable statement, since the stored procedure takes two parameters, we’ll make use of our question mark place orders for the parameters.

[snip] ... See Transcripts tab
150 chances to become an millionaire

150 chances to become an millionaire

wildsbet.com

#big wins#winners#games#casinos

About the Site 🌐

This site provides links to random videos hosted at YouTube, with the emphasis on random. 🎥

Origins of the Idea 🌱

The original idea for this site stemmed from the need to benchmark the popularity of a video against the general population of YouTube videos. 🧠

Challenges Faced 🤔

Obtaining a large sample of videos was crucial for accurate ranking, but YouTube lacks a direct method to gather random video IDs.

Even searching for random strings on YouTube doesn't yield truly random results, complicating the process further. 🔍

Creating Truly Random Links 🛠️

The YouTube API offers additional functions enabling the discovery of more random videos. Through inventive techniques and a touch of space-time manipulation, we've achieved a process yielding nearly 100% random links to YouTube videos.

About YouTube 📺

YouTube, an American video-sharing website based in San Bruno, California, offers a diverse range of user-generated and corporate media content. 🌟

Content and Users 🎵

Users can upload, view, rate, share, and comment on videos, with content spanning video clips, music videos, live streams, and more.

While most content is uploaded by individuals, media corporations like CBS and the BBC also contribute. Unregistered users can watch videos, while registered users enjoy additional privileges such as uploading unlimited videos and adding comments.

Monetization and Impact 🤑

YouTube and creators earn revenue through Google AdSense, with most videos free to view. Premium channels and subscription services like YouTube Music and YouTube Premium offer ad-free streaming.

As of February 2017, over 400 hours of content were uploaded to YouTube every minute, with the site ranking as the second-most popular globally. By May 2019, this figure exceeded 500 hours per minute. 📈

List of ours generators⚡

Random YouTube Videos Generator

Random Film and Animation Video Generator

Random Autos and Vehicles Video Generator

Random Music Video Generator

Random Pets and Animals Video Generator

Random Sports Video Generator

Random Travel and Events Video Generator

Random Gaming Video Generator

Random People and Blogs Video Generator

Random Comedy Video Generator

Random Entertainment Video Generator

Random News and Politics Video Generator

Random Howto and Style Video Generator

Random Education Video Generator

Random Science and Technology Video Generator

Random Nonprofits and Activism Video Generator

By using our services, you agree to our Privacy Policy.
Alternative random YouTube videos generator: YouTuBeRandom
vTomb © 2024
By using our services, you agree to our Privacy Policy.
OK