Java Database Connectivity || How to connect MYSQL and NetBeans 21 || #jdbc #jdbctutorial#jdbcinjava

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] Welcome to our channel so today we are going to learn about the Java database connectivity practical application we all learned the theory of java database connectivity but today we are going about to know about the practical application so let's start the video before starting the video I will like to inform you that for this you will need two programming languages or two applications that is Java networks ID and mySQL database so both these applications installation video is available on this channel you can refer to the description box or you can refer to the previous videos available on this channel so moving forward Java net means ID and MySQL ID we have to connect this so for connecting these two we are going to use connected J driver that is jdbc so let's see how we will download it first of all we have to open the Chrome browser and in the search box we have to search connected after searching connected you will be able to see here download connector again showing so we have to click here after clicking on it you are able to see here that by default Microsoft Windows operating system has been selected but since Jaffa language is a platform independent language so here we have to select platform independent okay after selecting platform independent you will be able to see here two files one is having file says 4 MB and other is having 4.8 MB so we are going to download the file with having the larger file size so let's click on the download icon so you are able to see that download has been started and our file has been downloaded after going into file manager you will be able to see that MySQL connected J drive has been downloaded so here you have to select it and right click on it since this file downloaded into gif file so we first of all we have to unzip it so for unzipping it we have to click on extract all so you are seeing seeing that we are extracting the file so you could see that unzipping a file has been done and the normal folder has been created by default so let's go to it so here in Services menu we have to click on Services thereafter we have to click on databases and right clicking on it we have to click on new connection after clicking on new connection here you could see that the driver is showing by default if the driver has not been shown you have to click here and add the driver for adding the driver you have to click on new driver or you could select connector J driver which whichever you want to select thereafter adding it for adding it you will be shown to the file manager and here you have to select that file after selecting that file you have to click on next so here you could see that you have to enter the password the password required is of the MySQL password because when you were installing the MySQL at that time you must have created a password that password that password you have to log in here thereafter you have to click on test connection since you are able to see that connection succeeded thereafter you have to click on next again click on next and here you could see that we have to click on finish so doing any type of programming in advance ID we have to create result so here we are going to create the project so for it you will have to click here so here you have to click on new project and clicking on new project you have to select Java with and thereafter here you are able to see that Java application and you have to click on next here the project name is showing by default if you want to keep this name keep this otherwise if you want to change it you could change it and thereafter you have to click on the Finish button so here you are able to see that new project is being created a new project has been created in the first step we have to expand the Java application 27 so here we will click here thereafter we have to right click on libraries after right clicking on libraries here you have to add Jr folder so click on it after clicking on it you have to again add the file connector zip file okay so we will add this file so you could see that MySQL connector J has been added here so further we will start the our program in our coding so here we have to establish the connection for establishing the connection we have to use the connection class and connection classes found in java.sql packets so first of all we will import that connection class so for that we will use import java.sql after importing the connection class we have to create object so here we will create an object class is the name of a class so here we are going to use the class for registering our driver to register our driver we have to use forename method so here we are going to use the forna method so we have to pass the URL for the class through foreign so we have to pass the same new model through it so the URL which I have written here you could see here this is the URL so you have to write the same URL and here you could see that an error is showing with the red line to remove that error you could manually use try or catch method otherwise you will have to click here after clicking here you have to click on surround statement with try and catch so as you could see that after clicking on it the error has been gone so the object which we have created there we have to write here so we will write the object which has been created so we will write c equal to driver manager so for taking the driver organ manager we will have to import it as we have imported the driver manager in the previous steps similar way we have to import the driver manager so I am importing the driver maintenance as you could see here we will write a DOT after writing a DOT connection method will be shown here so you have to use get connection method so here we have to pass the database URL for passing the database URL we will pass the three elements that is database URL database password and database username if we have passed the URL so after passing the URL you could see here the port number is showing here and the port number is double three zero six so you have to write here the name of the database which you have used so we have used MySQL so we will write here minus 12. after using the root we have also write the password so we are writing the password you could see that here the error is showing in the red color to remove that error we will click here after clicking here we will use add catch clause so error has gone thereafter we will print that c we have completed each and every step so this is the final step we have to run our program so let's run our program and see that our program is working or not so here you could see that we have received the output so I think that this video was helpful to you as I have explained each and every step in very brief so if this video was helpful to you please like share subscribe thank you
Info
Channel: Coding with Sudhir
Views: 18,838
Rating: undefined out of 5
Keywords: java database connectivity, java database connectivity tutorial, java jdbc complete tutorial, java jdbc connection mysql, java jdbc example, java jdbc mysql, java jdbc project, java jdbc tutorial, java jdbc tutorial for beginners, jdbc, jdbc connection, jdbc connection in java, jdbc driver, jdbc in java, jdbc in java full tutorial, jdbc in java tutorial, jdbc in java tutorial for beginners, jdbc tutorial, what is jdbc, what is jdbc connection in java, what is jdbc in java
Id: rgF-5CwTZeE
Channel Id: undefined
Length: 9min 52sec (592 seconds)
Published: Fri May 26 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.