Spring Boot | JPA | MVC | H2 Example
HTML-код
- Опубликовано: 16 июн 2018
- Spring Full Course : courses.telusko.com/learn/Spr...
Spring Full Course (UDEMY) : www.udemy.com/spring-5-with-s...
Angular Full Course : courses.telusko.com/learn/Ang...
Spring Boot | JPA | MVC | H2 Example:- github.com/navinreddy20/Sprin...
Editing Monitors :
amzn.to/2RfKWgL
amzn.to/2Q665JW
amzn.to/2OUP21a.
Check out our website: www.telusko.com
Follow Telusko on Twitter: / navinreddy20
Follow on Facebook:
Telusko : / teluskolearn. .
Navin Reddy : / navintelusko
Follow Navin Reddy on Instagram: / navinreddy20
Subscribe to our other channel:
Navin Reddy : ruclips.net/channel/UCxmk...
Telusko Hindi :
ruclips.net/channel/UCitz...
Donation:
PayPal Id : navinreddy20
Patreon : navinreddy20
www.telusko.com/contactus Наука
You're great. Simply Superb. The best part is you make videos with very less/no preparation. All on the fly spontaneously. Just a Genius bro!
Please more and more video on spring boot..content are very good..and your teaching styles are awesome..good practical video on spring boot..and interview questions also
I have started learning java from basic to advance and getting confidence just because of you. Your excitement level while making video makes more interest as a learner. You are my favorite. please keep sharing your knowledge. Big thumbs up :)
Thanks so much, if all lecturers in the world could teach like this, technology would be growing 10 times.
After Spring Boot 2.0 the data.sql should be import.sql. Hope someone find this useful. Btw this is an amazing tutorial.
Thank you so much for the tip.
Thanks! :)
Big thanks to bro =))
Thank you so much!!!! I LOVE YOU!!
Thank you so much bro ..Thanks for your tips it's working now
You are a really awesome brother. We can easily learn a new framework just because of your teaching style and knowledge. Thanks a lot.
I had some problems starting this project, but one I solved those, I understand all perfectly. Good video.
Great Video Navin! I loved it, in memory database.. I used to think about inbuilt database & now I can use it. I am new to spring boot & I am loving it.
Thank you Sir , you make every topics simple and clean
You're the best so far people just must watch and like thanks for your time sir!!
We'll be waiting for more videos 😊 I've been learning a lot..
You are awesome man. You are the greatest alien i ever seen thanks a lot;
Keep posting! We want more :)
Thanks a lot! Great video and very detailed description.
Good topics discussed sir.. Many many thanks 🙏..
New versions of Spring + H2 doesn't create remote database at startup, for security reasons.
Nicely explained. Its really helpful.Thank you!
Learn New things from every video, Thanks
Teluskunnanu. Thank you sir :)
really sir , u r doing good job,ur explantion is super
Navin Reddy great man!!
Your explanation is very much interesting specially in term of technical things 👍🏻
Thank you sir,
It's very helpful for us..
If you have created data.sql and written this query :
Insert into alien values (101, 'Navin')
Then you entered the h2-console and run the following query :
Select * from alien
And it only shows you an empty table with the column names AID and ANAME but no rows.
Then add the following 3 lines in application.properties :
spring.sql.init.mode=always
spring.jpa.defer-datasource-initialization=true
spring.jpa.hibernate.ddl-auto=create-drop
After doing this, I was successfully able to insert values into database from data.sql
Still gives error
Thanks a lot.
After adding these 3 lines in the 'application.properties' file, I have
successfully inserted values into database from the data.sql at Runtime.
Thanks a lot, you have saved me a huge amount of time in resolving this issue.
@@shankarraj3433 Happy to help! Made this comment more than a year ago, but I'm glad it's proving useful to someone!
@@curiously-cinnamon Ya, it helped many. Thanks.
Chala easy way lo Cheptunnaru Navin :)
Thank you sir.. Your videos are very helpfull.
Very nicely explained.
I must say, you are the best alien ;)
Excellent sir.....keep going
This is Perfection
Thank you, sir
You are great
Excellent...thq!
Very good Thanks!
Hi sir, in the above program, we had created the text editor to execute the queries in h2 database. But if we use the database as mysql, where we have to execute the queries.
Excellent!
BRILLIANT!!!!!
Man you are Great amd so is SpringBoot.:')
Thank u for this.
Thanks for the video. I have one concern. Where to write customized method or to solve complex operations or giving more no of parameterized method. Which are not part of Interface.
Thanks Mr. Navin.
Awesome!
super bro...
@Telusko Learnings Can u please tell me how to get colorful logs in the eclipse console. It would be very much helpful for us.
Too late but. Use Spring Tool Suite and run your webapps as Spring Boot Application
When i hit the url ...it gives me whitelable error.. so i added @RequestMapping now its printing home.jsp on browser. i am not getting that name and id and submit form. I added home.jsp file in webapp folder as you show and even added jasper dependency. Please help
Thank you so much!!!
Can we use multiple database engine (MySQL, PostgreSQL, Mongodb, DynamoDb) for single webpage at a time?
Very nice video. Why AlienRepo class is not annotated with component but how autowire is still working ?
Thank you so much. I have one question, whenever I restart the server all of the submitted data are lost what should I do?
For the record, the 1000th like was mine.
Very nice sir
I have a really Important request, and that is to show us how to write sql query using spring mvc. It is one of the things I need for a project. Most applications need to run sql in the code, not in the database.
Thank you vmuch
I just now knew that a new runtime database named H2 Exists in a world lol ..but thanks anyway bro :D
AlienRepo is a interface.how did you create instance for interface through Autowired Annotaion
I have a question. AlienRepo extending CrudRepository interface. But which class is implementing CrudRepository interface ? without implementing it, can we use it like it ?
Hi Naveen Sir, I have a question regarding the Alien repo, I saw that the repo is not annotated but still with Autowired annotation we were able to get that object inside the controller?
Hi Navin... was going through your videos. Its very well expalined. But I am looking for a code which can fetch data from database using non-primary keys. Say for a Employee table(Empid (Primary key), Empname, EmpEmailId, EmpSalary) , I want to write a web rest service to fetch employee details by email id being passed as a path parameter. Any document or suggestion would be really helpful.
good job
which is the best screen recorder for laptop
Awesome
Sir, your explanations are superb!!! I get aid, but not getting aname in database while fetching through program jsp page. But while fetching through data.sql or directly in database I got both aid and aname. Could you please guide me. Thanks
Very nice
Sir go more brief with spring Boot
The only bad thing about this video is that I can hit like just one time. I would upvote this 10 times
How does repository save the data ,as it is the interface and we have not implemented it any where...please explain
Thank you
Hello Sir, can you explain what you did at 2.35, how to make that form tag?, I am new learner, so far enjoying your content.
I have a Question
that AlienRepo is not annotated with @Component annotation then how come Autowiring of the same Object happening?
how can we put auto-generated id's while deploying the app itself insert into alien values('sk'); now the id's should automatically inserted
Thnakyou Sir for the most amazing videos on JAVA
one update in configuration in application.properties
spring.jpa.defer-datasource-initialization=true
spring.h2.console.enabled=true
spring.datasource.url=jdbc:h2:mem:adm
above will work
i have doubt that how jpa is capturing the values which you added in the name and id fields?
Navin ji,
you have not annotated repo interface with any annotation(@Repository) . How come Autowired worked in this scenario??
the repo interface extended CrudRepository, you can go there to check the annotation there.
can you tell me how to retrieve data from the h2 db?
sir make video on spring security with spring boot
When I hit the url it is showing whitelabel error page. The console is displaying an error as: An established connection was aborted by the software in your host machine. What should I do?
at min 4:17 when I run , it gives me the same error , I think I have a problem in request mapping, I wrote same as you , so is it a problem because of the application properties?? or what should I change to run it
I encountered a problem where the H2 database was not being created, It turns out that the package name of model should be under demo. Because I created mine com.example.model instead of com.example.demo.model.
Yes, That's it! You have solved my problem. Thank you.
Plz can u make a vedio on how to save file in database using spring boot hibernate
I want to use MySQL instead of H2 database in this project, how can I do that?
Thanks
ur tutorials r really good.....plz help me as i m not able to create table via ur instructions......database is created but table is not created
Your your JDBC url in h2 base has to be same as url in aplication.properties file
please provide more videos navin
Can you give some information to how to connect database from MySQL.
do we have to add spring web?
If you re getting error :
Database "/Users/amandeepverma/test" not found, either pre-create it or allow remote database creation (not recommended in secure environments) [90149-200]
Then you can fix it by setting the value in "JDBC URL: " column to -> jdbc:h2:mem:navin
thanks.
Sir, it showed the error message that the remote database is not created.what should i do??
what is the use of @responsebody controller?
Correct the classpath of your application so that it contains a single, compatible version of org.apache.tomcat.util.file.ConfigFileLoader How do i get this error?
How do you define the datsource url ?
you did not use service class could you explain why it is need or not needed?
The same question I wanted to ask. Does anyone know?
Can we use spring boot with Mysql Views?
On Which ide you are working?
After creating data.sql file I am encountered with this error,
Exception encountered during context initialization - cancelling refresh attempt:
i can see the database but can't see the table. any idea?
Sir while I am hitting on addAlien in browser i am getting home page and inserting the value there and the data is getting saved but along with that is also saving null after that for name and 0 for id
You resolved that issue bro?
Can anyone please tell me why are we not using @Component in AlienRepo interface, as we are using @Autowired while creating object of this interface in lnside controller.
Hello Sir, I'm having a problem while inserting data through sql file. The data is not inserted in the columns in order. It builds table with fields in alphabetical order. For example, Table[id,name,college] but it creates as Table[id,college,name]. Please help me to solve this.
Hi Navin,
you have not annotated repo interface with any annotation(@Repository) . How come @Autowired worked in this scenario??
Please let me know , I am not able to understand this?
Sonal Gupta
Hi, I am having same doubt, if you found the answer, can you please tell me.
@@gunjanrathore8101 adding to the above part, we will get bean exception when we try to create instance for interface
Crudrepository will extend those all methods
what if i want to use mysql db??? please reply sir
I am getting different sequence in my database table inspite of the one which I have written in my view file for example in vo I write stateId,stateName,stateDesc and in database I am getting stateId,stateDesc,stateName please any one can say what is the problem