How to connect NetBeans Apache to SQL Server

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
people on tonight's episode we'll be speaking about how to connect sql with netbeans so for a start we need to open netbeans uh just be mindful that netbeans have changed their ide is no longer just netbeans it's apache and pins and i'm using version 12.3 the same time i'll also open open sql server management studio you actually need both of these tools installed on your machine for you to perform this task of connecting netbeans with sql server so whichever open first we're going to start there okay as you can see netbeans is the one that started first so we're gonna start at netbeans so when you open that pins it basically opens in this fashion so you will want to go create a project and we will call our project it will be a java program so where i'm just going to create a java application and i'm going to call my project connect to sql [Music] right so that will be the name of the project i'm going to ask java to create a main class for me and the main function so by doing that java will create the main class in the main function right so that is basically what you need you just need to create a simple project and um you will let netbeans do the rest for you next up we want to go and connect to our sql how we normally connect to edge so my sql server is this one and i'm quickly just gonna connect like this but the year there are other ways i usually log into this sql server myself um that i want to create so i have a user here called tendo that's basically how i prefer logging in it's much more safer it brings you to um you need to know the ip address and all that but most of you are already familiar with that for now so i'm just gonna go find out my ap address for the machine [Music] okay so my ip address is 192 um eight point four three point eight seven [Music] i'm going to use that to connect and i'll say comma change change one which is the part that i wanted to set up and remember all these stages have already been explained in the other video so i will say sql server authentication so if you watch the first videos on how to set up sql as a server and login as a independent user you can start there then come watch this one there we go i have now logged in um the next thing i want to do is to create a database so i am now creating my own database i will call this java db and press ok from there on my newly created database i'm going to create a table and i'm just going to create a simple table of users so i'll create uh user id and it's very very important that you don't start on this video you start somewhere else maybe if you don't know what i'm performing right now by setting this up as a primary key and then making sure that it has identity specification maybe you might want to watch that eight minutes video on identity specification it's also part of this playlist so i'm just gonna put the names of the person here maybe email as well and then password here so i'm creating very very very simple database [Music] this is the table i'm creating a database so i'm going to press save now and i'll call this users [Music] okay so that's all we need to do on sql for now right so next step you will want to go to your internet and type um [Music] j d pc driver for sql right so this will then uh navigate you to arrive at a place where you'll find the jdbc driver for sql server and then you can try to locate where can you download this jdbc uh driver it's it's it's very easy to locate it um you won't have to be looking for it that much so you'll find it under microsoft right and you will have to look for the driver itself but you will want to get the latest driver so the jdb6 driver i don't think this is the latest one so we're going to again look for the latest one so say jdbc driver for sql i think this is the one once so we arrive here and then you look for the download button here we are i prefer downloading the one which is a zipped file so if you download this file right if you download this file it will then come on your downloads or wherever your files go to come you know downloads and it will come in this fashion right so this is the file i've just downloaded previously and then you need to unzip it after unzipping it it looks like this so don't forget you are here you download the driver as a zip file or as a tar um file then you unzip it and your file will look something like this so inside this file you have got the drivers themselves for java so these are the three drivers we're speaking about okay so there's driver for nine point for java eight java eleven and uh jre 15. so from there you need to go back to netbeans and just within your project you're going to navigate to services and you're going to add a new connection on your databases right so just come here say add new connection look for a new driver here and then add your driver the driver you'll be adding is that one i've just shown you right so navigate to where you unzipped that file and make sure you click your driver it will come here and then it will ask you for all those other questions at the end of the day it will look like this then you can then navigate and put in those um login details which are needed for your database so what you're typing in is basically what you will be typing if you attempt to log in here right so you've got the server name the login name the password the database name the table name as well it's also required not the table name just the database name so from there you are going to put the database itself i was calling it java tb and then from there the username then i put in the password when i test the connection it says connection succeeded i can just press finish then it's going to create a connection string for me now if you want to test if these things work what i'm going to do now is i'm just going to click on it right and say execute a command then i will start typing in those famous commands like select all from the table users right and i will try to say by executing if this indeed will return a table so as you can see it does return a table with user id the names the email and the password right so this is telling me that netbeans has now been connected to um to sql okay hope you enjoyed see you next time
Info
Channel: Thendo Bakali
Views: 663
Rating: undefined out of 5
Keywords:
Id: DPJoEDhQaMU
Channel Id: undefined
Length: 10min 32sec (632 seconds)
Published: Tue Mar 23 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.