Hey there welcome back friends, let's move forward and in this video we will try to create a schema using workbench. And moving forward we will also try to configure our application so that our application can connect with the database. Now when we open workbench we have this available connection which is already created. And the username and password was root and root which we are using to connect with our database. And in here, first of all, we must create a schema. And what is the schema schema is the database and inside the database we will create tables.
Now, if I show you here, at the left bottom of the screen, we have the listing of the available schemas and if I right click, we can create a new schema in here. So we will be creating a new schema by the name of blog. And let us click on Apply and a new schema would be created. Amazing. Now friends our schema has been created. Now let us navigate to this option databases and let us click on this option connect with the database.
Now in here there are a couple of settings. These are hostname, and then apart from that we have this port these are the default settings and this this particular host name is 127 dot zero dot zero dot one. This is nothing but an alias of our localhost or the localhost is the alias of this IP. Both are same. Now friends, when we are like billing to connect with the database, we need to connect with the database via a URL there are a couple of settings and also take a note of this schema name. Even the schema name needs to be specified on our URL.
Now How to get the URL. Let me show you one article. So if we navigate to Google and search for spring JPA with MySQL, you will get this particular article from spring.io. And the URL for the article is spring.io slash guides slash GS slash accessing data MySQL. And if you open this particular URL, it will give you an example that how we can connect with that database. Now do check this article.
This is a very interesting and good to know article. Do check this out. Now friends, one of the very interesting and very important settings, which is given in here is creation of this application or property file. And inside this file, there are a couple of settings and these settings are very important to get connected with the database. The settings are based on URL username and password. Now apart from that there is also one more setting related to the hibernate dot DT L and there are a couple of options available to us.
And for more information do check out this article. By default, the Create level which is given in here is good enough for us and we will go with the Create option only where we can definitely create things but we won't be able to drop things from that database table. So let me copy these four settings real quick. Let me minimize this article and we will open up sts and in here if I show you inside this package resources we have this particular file application or property let me paste in the settings. And now let me make the modifications in here the URL is good enough but the name of the schema is something else. That will show you the name.
The name is blog. So we will give the name as blog in here. Apart from that, we will also add in a Jetta get parameter which is us As l equals to false. Now, as of now, our web server on our localhost doesn't have an SSL certificate. And in order to get rid of the warnings, we are simply disabling the use of SSL, you can definitely make use of SSL if you would like. In that case, simply remove this part from the URL, the username would be root.
And for sake of convenience, we have kept password as root. Again, let me save the changes. And if now, I run our application then our application should run. So I will right click navigate to run as and we will run this as a Spring Boot application. Let me show you the console. And here is our application up and running.
Definitely there is no business logic and we will add business logic from our next video. So this is amazing how you We are able to connect with the database using simply four lines. These are the only settings which we need to get connected with the database and in the background, a lot of the stuff are happening by default so this is amazing. Alright, so that's it for today. I hope you guys enjoyed this video. Thanks for watching.
Have a nice day and take care