Hey there, welcome back friends, let's check a couple of more things related to that database connectivity settings. Now, as of now, if I show you, we have four values in our database, and we can again check this by taking help of a workbench. So, information is present in the database, we are able to fetch the information everything is good enough. Now, let us quickly navigate to our sts and in here we have something known as application dot properties. Here is the file and we are making use of these three settings. Now, if I show you the article, which is given by spring.io in here there is this fourth setting right and for example, I use this setting then there are possible four values first value is nothing Which is the default value then there is the update value which says hibernate changes the database according to the given entity structure then we have create creates the database every time but don't drop it when close and then finally we also have this create and drop creates the database when drops to when the session factory closes.
Now there are these four options. Now these four options are for which property definitely the name of the property is a spring.jpa.hibernate.dd L dash auto. Now what does this DDL stands for this DDL stands for data Definition Language and this language. This part this category is science for the language the queries which help us to manipulate the structure of the database tables, right? So this is good enough. So this DDL Language will help us to drop table CREATE TABLE menu plate, table structure, things like that.
Whereas there is yet another category by the name of a DML data manipulation language, which helps us to manipulate the data for example, CRUD operations, create a row, delete a row, update a row or for example, read a row. So DML language is a yet another category. Now in here we will talk about this particular property. Let me copy this particular line. And let us navigate to our application dot property file. And let me save the changes.
Now, for example, I relaunched this application before that, let me also show you the values in the database table. We do have the values, but when we save the changes, and we use this property and we relaunch the application, something amazing will happen. Let me show you the console the application is up and running all the information the data inside this particular table will be lost there is nothing inside this table. Now, why this happens? This happens because when we give the DDL auto the value as create or update or create dash drop this will try to create a table based on your entity class right. So, in here we have this entity class right.
So, for example, we delete the database table directly. So, in here let me drop the table. Now, if I fire this query, there is no table there is nothing right. There is nothing. Now for example, I restart this application. In fact, because we have given the value for this property as create basis On our entity class, a new table would be created.
Let me show you. So in here, if I open up a workbench and if I fire the query that is this table right. So this particular property this particular property is very powerful. This can create tables in the database. This can truncate the information from the database. So do take a note of it, there are provisions using which we can also dump the data when we restart our web server.
So do the search on internet related to this file, do research how to handle scenario accordingly because this property can truncate data as well. All right, in our case, we are handling third data dumping thing manually. So definitely we will get rid of the setting. We Don't need it. We don't need a Spring Boot to create database table or a dump of data. We don't need it so we don't worry about it.
But when it comes to your application, your productions, your production environment, do take a note of this property. This is a very powerful property. All right, so this is it for today's video. This is a bonus video where I have just given you a high level information related to the property by the name of spring dot JPA dot hibernate dot DDL dash or toe? Alright, so that's it for today. I hope you guys enjoyed this video.
Thanks for watching. Have a nice day and take care