Hi! Please advise why did you decide to place fileDb in './data/fileDb' (spring.datasource.url=jdbc:h2:file:./data/fileDb) ? Could it be in './src/main/resources/data/fileDb' folder? Is there any difference?
also, if you use SpringSecurity, in your WebSecurity.configure method to configure HttpSecurity, add .antMatchers("/h2-console/**").permitAll() (if your h2 console path is default "/h2-console", if not change to your path, in this video, it would be "/h2/**".
Hi!! It works for me with jdbc:h2:mem:test but when i try to store the database in a file there is no table att all when i login in h2?? Its a spring boot app with html form so i dont add throu java code. Any suggestion?
When I start the project, Hibernate makes all the tables and connection automatically. It works fine. if I run the query INSERT INTO ROLES (NAME) VALUES ('USER') first time manually in the h2 console, it inserts USER with ID 1 correctly. But if I run the query INSERT INTO ROLES (NAME) VALUES ('ADMIN') after the application restart, it inserts ADMIN with ID 33 instead of 2. The third run starts with 65 and so on. How could I achieve, that the ID continues from where it finished at the previous application run?
Hey! Thanks for feedback! Glad you like it. Recently i don't have much time, but if you struggle with technical issue try to ask a question on stackoverflow. You can find there a lot of experienced developers willing to help.
I couldn't connect to database via h2-console , I got this error : Database "mem:salam" not found, either pre-create it or allow remote database creation (not recommended in secure environments) [90149-214] 90149/90149 (Help). How can I fix it?
Exception in thread "restartedMain" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.repositories.DiscoRep' available at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:351) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:342) at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1172) at com.example.demo.Yes1Application.main(Yes1Application.java:18) ... 5 more
Thank you Maaan!! You did what i have been looking for so long. Please keep doing your job! It is really valuable!!
the tutotial is absolute clear and understandable.. I could build and run the project with textpad, and in command prompt. Thank you Very Much!
You are welcome!
Thank you, I learned a new way of writing from your video. I am very appreciated it.
Hey! Glad to hear that! Keep coding!
Great Explanation
Glad it was helpful!
Thank u so much i was having a lot of troubles to do this connect thing you'rea savior
Great to hear that! Thanks for the feedback!
Thanks your help me in this moment, is a great help for me
Glad to hear that!
is it possible to use hikari with an in memory database like h2 just to test the pooling?
Your explanation is so good, thank you very much!
Glad you think so!
Thanks man for this awesome tutorial!
Happy to help!
Hi!
Please advise why did you decide to place fileDb in './data/fileDb' (spring.datasource.url=jdbc:h2:file:./data/fileDb) ?
Could it be in './src/main/resources/data/fileDb' folder?
Is there any difference?
Nice explanation! Love ya!
Thanks!
Thank you I like your explanation
Glad you like it! Thanks for watching!
also, if you use SpringSecurity, in your WebSecurity.configure method to configure HttpSecurity, add .antMatchers("/h2-console/**").permitAll() (if your h2 console path is default "/h2-console", if not change to your path, in this video, it would be "/h2/**".
Wow! Super clear helped me a lot!
Great! Thanks for feedback!
Hi!!
It works for me with jdbc:h2:mem:test
but when i try to store the database in a file there is no table att all when i login in h2??
Its a spring boot app with html form so i dont add throu java code.
Any suggestion?
Awsome man.... Thank you
You are welcome!
When I start the project, Hibernate makes all the tables and connection automatically. It works fine.
if I run the query INSERT INTO ROLES (NAME) VALUES ('USER') first time manually in the h2 console, it inserts USER with ID 1 correctly.
But if I run the query INSERT INTO ROLES (NAME) VALUES ('ADMIN') after the application restart, it inserts ADMIN with ID 33 instead of 2.
The third run starts with 65 and so on.
How could I achieve, that the ID continues from where it finished at the previous application run?
It is about configuring generation strategy of ID for specific entity. For example you can define sequence generation strategy with allocationSize=1.
@@CodeForgeYT i use @GeneratedValue(strategy = GenerationType.SEQUENCE).in your tutorial id is 33 after 1
@@azermirzayev648 Try to set allocationSize
@@CodeForgeYT i used ...allocationSize = 1. result same
hello codeForgeYT,
Your videos are mindblowing , actually im making a small project can you help me regarding that project
Hey! Thanks for feedback! Glad you like it. Recently i don't have much time, but if you struggle with technical issue try to ask a question on stackoverflow. You can find there a lot of experienced developers willing to help.
I still can't reach the console in the browser. I have also tried configure HttpSecurity and all that. What is the issue?
Take any source code from github that I have shared and check if it works for you.
what IDE he did use?
Intellij IDEA
I think you forgot to add property for h2Dialect use?
It is not mandatory to make it work, but for sure can be added
@@CodeForgeYT I had to add it
I couldn't connect to database via h2-console , I got this error : Database "mem:salam" not found, either pre-create it or allow remote database creation (not recommended in secure environments) [90149-214] 90149/90149 (Help). How can I fix it?
Hello, you should delete DB_CLOSE_DELAY=-1 line and all will work well
Exception in thread "restartedMain" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.repositories.DiscoRep' available
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:351)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:342)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1172)
at com.example.demo.Yes1Application.main(Yes1Application.java:18)
... 5 more
Fuck it, it was the folder structure, how could something so petty have made me waste so much time figuring out the exception? :((((