Now we have a database already in the cloud and we know how to connect if we want to leverage JDBC user
details manager, which is the implementation provided by spring security that extends user details
manager.
We have to add to the whatever expectations that this class has.
The primary expectations that this class has is you should have the same table in the same column names
inside your database also so that you are free to use this class without changing anything.
But if you really have a requirement where you can go with this table and columns, names, we will
see how to customize that in the coming radius.
But in this scenario to test authentication mechanism using databases, user details manager, let's
try to create the same tables with the same column names in the database that we just created.
So the table names should be users, followed by the columns, names, username, password and enabled.
And at the same time, we also have separate table for authorities, which is how a column, name,
user name and authority.
So now I'm going to the database here.
First I have to create a database.
So right now I have my score.
But there is no database that I want to create my tables because inside an obscure server database we
can have any number of databases.
And since it's a brand new MySQL server, I just want to create a new database as per my requirement.
I'm just naming the database as easy bank and executing this comment since we can.
With the admin credential, we should have the right to create databases, tables, other users assign
authorities to them.
We can do anything on that database creation perspective.
So now I have created and you can see on the left hand side a new database has been created.
I'm just running use easy bang for my next Ezekial statements and I'm going to run.
So now you can see that we have to execute this command to create temporary users with the same three
columns that we have seen in the code, which is username, password and enabled.
It is a column which maintains primary key value.
And I'm running this statement by running.
You should have a table name with users post that.
I also want to create an authority table, as mentioned in the code, which have a user name link between
these users and this authorities, followed by authority and the primary key value column, which is.
So I'm also executing this command so it not to be selected and how to select use easy bank and around.
This is good statement which will create authorities.
Lastly, I am going to insert values inside this table, the very first table that we created as users.
I'm going to create a user name called Happy With the Password one, three, four, five.
And enable is an indication one one means it is enabled.
Zero means it's a disabled.
It's an indication to the framework post that I also how authorities were taking the same user which
is happy and then giving authorities the right for him.
So I'm running the both of them and now the data has been inserted.
Now we have a proper user inside the database.
The name Happy Now in the next video, let's try to connect this database into our application and leverages
JBC user details manager to authenticate inside our application.
Thank you.
And see you next week by.