Spring Boot 2.1 Tutorial | Connecting to Databases | 2019

Поделиться
HTML-код
  • Опубликовано: 19 ноя 2024

Комментарии • 121

  • @JoshuaTorresBerrocal
    @JoshuaTorresBerrocal 5 лет назад +19

    For people that just watched the previous video, you can start at 9:30

    • @amigoscode
      @amigoscode  5 лет назад

      thanks buddy

    • @borjovsky3164
      @borjovsky3164 5 лет назад +6

      First part here: ruclips.net/video/r-6BwGW4Sr8/видео.html

  • @uffeheden6100
    @uffeheden6100 2 года назад

    Thanks for a great channel and very good content! I'm in a boot camp style of education to be a java programmer right now and your channel is almost like a blue print of everything we learn. Like it a lot and the way you explain everything, Slow and easy to keep up to. Not like other channel where everything is exlained in 10 seconds and then you have learned zero. Keep up the good work!

  • @antonhen23
    @antonhen23 4 года назад +1

    Thanks again! Can you create videos about architectures? like N tier, pipeline, polygonal , etc. And tell us what are pros and cons? And how to determine which architecture will fit best for which specific purposes?

  • @buddhika71
    @buddhika71 5 лет назад +3

    I've been waiting for this...thanks man

  • @Merserissugoi
    @Merserissugoi 5 лет назад

    thanks. ive been binging your videos for a few days now. im debating buying your course now

  • @ayman8423
    @ayman8423 3 года назад

    I came from Laravel, the spring is very complex you have to write ten-line code to do one query. I don't know why people still use spring.
    The funniest thing, the instructor thought with spring we can write code very fast

  • @maksimpatapenka2076
    @maksimpatapenka2076 4 года назад +1

    Hey, I have a few questions. Why do you use UUID + extension for postgres instead of bigint/integer + sequence generator? And the second one: why don't simply use spring datasource autoconfiguration provided by spring boot instead of manual configuration PostgreDatasource?

  • @daniellaerachannel
    @daniellaerachannel 5 лет назад +1

    1 dislike: wtf is his problem?! thanks a lot man

    • @amigoscode
      @amigoscode  5 лет назад

      hahahahah thanks brother

    • @borjovsky3164
      @borjovsky3164 5 лет назад

      maybe racism or some other dementia...

  • @marcincylkowski3004
    @marcincylkowski3004 4 года назад +1

    You are Best guy on RUclips :) very good content!

    • @amigoscode
      @amigoscode  4 года назад

      and you are the best subscriber :)

  • @zenande699
    @zenande699 5 лет назад +2

    Thank you so much. I've been waiting for this video 🙂🙂

  • @moglimogify
    @moglimogify 5 лет назад

    Excellent. Easy to understand and straight forward. Thanks very much

  • @KhaingOfficial
    @KhaingOfficial 4 года назад

    Good tutorial, I am a new Spring boot, so I hope you will have more tutorials about spring boot

    • @amigoscode
      @amigoscode  4 года назад

      oh yes. checkout my website. amigoscode.com/courses

  • @derreck3424
    @derreck3424 5 лет назад +3

    Another great video, can you cover Spring Boot JPA?

  • @anumshaikh
    @anumshaikh 4 года назад

    Hi Nelson yet another helpful video !!, please make one video with hibernate, JPA

  • @jasper5016
    @jasper5016 4 года назад

    Very good video. Thanks. Not sure why did you use JDBC in place of JPA?

  • @YBenarab
    @YBenarab 3 года назад

    Are the any way to use the Application.Properties to connect instead of deleting it and creating the Application.jar file? No matter what I do it just keep pointing at my local postgres database instead of the one in docker...

  • @mirautube80
    @mirautube80 4 года назад

    Excelllent.. what changes I need to do to connect to an oracle database?

  • @TheBibleStoryAnimation
    @TheBibleStoryAnimation 2 года назад

    Pls can you make a tutorial on how to connect and use MySQL database in Spring Boot

  • @midasama3124
    @midasama3124 4 года назад

    I would really love to take a look at your testing code since it is not included in the source code that you provide in the description of the video. I am really struggling to track a NullPointerException while trying to recreate the little is shown in the video about testing the database access services.

  • @Tesseus2006
    @Tesseus2006 2 года назад

    Hi there! I tried to follow the tutorial. But the link to the code to be cloned in the tutorial, seems to be different than the one explained in the video and I tried to locate the correct code in your repository list and couldn’t find it. Thought I would let you know. Is the code still available somewhere else?

  • @abegobe6468
    @abegobe6468 4 года назад

    I am following this tutorial and I am trying to develop a todo list app with Spring Boot + Postgres and JPA ORM requirement. in meantime, I didn't find any solution for below questions?
    Really I need a docker for this project?
    I can change this project into JPA ORM?
    How can automatically move my table to my PostgreSQL database?
    Do I need any VPN or xampp for connecting Postgresql to SpringBoot?

  • @dfordemo981
    @dfordemo981 4 года назад +1

    thanks man, you are awesome

  • @josipjurenic1456
    @josipjurenic1456 4 года назад

    Hi, I am getting a little bit confused... So my demodb is running on Docker on port 5432 and if i try to open SQL Shell and choose port 5432, than I can see my demodb, but if I open pgAdmin I can't see demodb because it's running on different port. I tried to run pgAdmin on 5432 but I can't because docker is already running on that port. Btw Great Video!

  • @romaelsimmonds4338
    @romaelsimmonds4338 5 лет назад +1

    Great Video! Do you know much about MongoDB? Is the implementation much different with a mongo database?

  • @dotanrz
    @dotanrz 5 лет назад

    you are a very good teacher. thanks!!

  • @binnitubus
    @binnitubus 3 года назад

    Great Video!
    May I ask you a question?
    I want to use spring-jdbc to be more in line with DDD principle, and use as ID the uuid.
    My question is, how can I simply set up the entity to use uuid_generate_v4() as a default method for generating the ID? I notice that some use as DEFAULT into the sql script the uuid_generate_v4(), but this is the right way for doing this?
    Thanks!

  • @Scoty98
    @Scoty98 4 года назад

    Thank you sir. Do you planing make some with Hibernate JPA?

  • @sathursansathyaseelan7845
    @sathursansathyaseelan7845 3 года назад +1

    Unhandled exception: java.sql.SQLException
    in Query

  • @johnaustin4455
    @johnaustin4455 4 года назад

    Excellent tutorial(s)!

  • @senss3000
    @senss3000 3 года назад

    Thnks ! so useful

  • @CGStirk
    @CGStirk 4 года назад

    Thank you very much for this tutorial! I do have a question. Why are double underscores required for the sql file?

    • @amigoscode
      @amigoscode  4 года назад +1

      Is because of Flyway flywaydb.org/getstarted/how

    • @CGStirk
      @CGStirk 4 года назад

      @@amigoscode Thanks

  • @metin4yt
    @metin4yt 3 года назад

    Hello, how do we retry the connection to the database? Is there some application properties for that?

  • @Merserissugoi
    @Merserissugoi 5 лет назад +1

    did you learn spring boot by just reading through the official docs on the site?

    • @amigoscode
      @amigoscode  5 лет назад +1

      Merser yes the docs are great 👍🏾

  • @voodoocult955
    @voodoocult955 4 года назад

    Salam brother, I have question. I am confused that what is the diffrence between connecting to postgreSQL and connecting to PostgreSQL with Hibernate. Why we use Hibernate? I am actually asking because hibernate is easy to connect but Why we use it because we can connect to postgreSQL without using hibernate. Could you help me for this question? Thank you in advance.

  • @jonjackson5979
    @jonjackson5979 4 года назад +1

    Is the repo no longer available from GitHub?

  • @SP-cx8oq
    @SP-cx8oq 4 года назад

    Hello! In your opinion, what is the best documentation format for such restful services, for developers? What project documentation do you usually use on your projects? Thank you in advance!

    • @amigoscode
      @amigoscode  4 года назад

      I always use the official docs

  • @sathursansathyaseelan7845
    @sathursansathyaseelan7845 3 года назад +1

    Incompatible parameter types in lambda expression at 42:00

  • @saahilshah20
    @saahilshah20 4 года назад

    what needs to be done if I want to connect a NoSQl database like Cassandra?

  • @ItsTimeToCode
    @ItsTimeToCode 5 лет назад

    Great video. thanks!!

  • @vrak3D
    @vrak3D 5 лет назад

    Hi, great videos! Just one question, is there a reason to why you named it v1? some kind of convention? (api/v1..)

    • @amigoscode
      @amigoscode  4 года назад +1

      Yes. if you want to introduce a new version of the API you do not break the existing one and you can deprecate it

  • @pablohuanca5121
    @pablohuanca5121 4 года назад

    Thank you! this is awesome.
    How about Spring Batch with postgres?

  • @TigasFMS
    @TigasFMS 4 года назад +1

    I get an error at 32:55. It says that org.postgresql.util.PSQLException: FATAL: database "demodb" does not exist. I have the demodb database created on a docker container with port 5432 exposed. I don't understand why this is happening.

    • @amigoscode
      @amigoscode  4 года назад

      You need to create the database manually

    • @fazlizekiqi2324
      @fazlizekiqi2324 4 года назад

      @@freerider6300 did you find any solution

    • @608raju
      @608raju 4 года назад

      Any solution for this? I’m facing the same... is it specific to window 10??

  • @ralhanani
    @ralhanani 4 года назад

    Hi
    Thank you so much for this great video ;
    I have installed Postgres on Windows 10 and created the db
    I stuck at the 24:00, when I started the application I got the same error (Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured)
    1. I created the DataSource
    2. and Inject URL, Username and Password
    I appreciate any help Thx

  • @JY-qh7fm
    @JY-qh7fm 5 лет назад

    At 33:00 where you re-run the application, I encountered "Unable to obtain connection from database: Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections." error. Upon much googling seems like I might need to check if the postgresql.conf or pg_hba.conf file has allowed this connection but this file seems to be in the postgresql folder if installed directly and I can't seem to locate anywhere (maybe because it is a docker image?) Is there a fix to this if anyone encountered the same problem and found a solution? Would really appreciate it as I am still very new to docker/postgresql in general, thanks in advance!

  • @ultramaxx1155
    @ultramaxx1155 5 лет назад

    The github link is giving me "Page not Found". Is there another one to pull the repository?

  • @GuitarreroDaniel
    @GuitarreroDaniel 4 года назад

    Hey Nelson, thanks for the lesson. It seems that there's a mistake with the repository, the source code of this lessons isn't there :( Would you mind fixing it?

  • @marcocicala8222
    @marcocicala8222 5 лет назад

    Thank you so much. Great video =)

  • @realracso
    @realracso 4 года назад

    I'm having trouble with the deleteById method. When using the jdbc method .update() what type do you use for the last param?
    Also great video!

    • @amigoscode
      @amigoscode  4 года назад +1

      you pass the the id

    • @realracso
      @realracso 4 года назад

      Amigoscode thanks for replying! ill try it

    • @amigoscode
      @amigoscode  4 года назад

      Racso let me know if you need help

  • @KeffelewAssefa
    @KeffelewAssefa 5 лет назад

    Thank you Sir.

  • @RendyEzaPutra
    @RendyEzaPutra 4 года назад

    hey I'm using
    Spring boot 2.2.2
    and IntelliJ IDEA 2019.3.1
    and I think the debug is not enabled by default.
    How to enable it?
    Because when the error occurred, there was a line like this
    Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.

    • @amigoscode
      @amigoscode  4 года назад

      You need to stop and run the application in debug mode

  • @brayanhernandezmora8619
    @brayanhernandezmora8619 4 года назад

    Hey could you help me with something please I'm trying to validate my fields from my models with MethodArgumentNotValidException I override a method everything is fine but I don't know how to use it in my controller I've been reading that spring picks this up automatically but It's not working when @valid fails

    • @amigoscode
      @amigoscode  4 года назад

      @Valid from which package are you using?

    • @brayanhernandezmora8619
      @brayanhernandezmora8619 4 года назад

      @@amigoscode Thanks I already resolved that yeah I was importing wrong @Valid

  • @jeffscheirer3237
    @jeffscheirer3237 5 лет назад

    With the Postgres DB being containerized with Docker the data (database, table, data) will be lost when the container is restarted, correct?

    • @amigoscode
      @amigoscode  5 лет назад

      Yes thats why you should never put your database in a container in real life applications

  • @mariangabrielneacsu4873
    @mariangabrielneacsu4873 4 года назад

    Hey, very nice tutorial followed it all. I have an error though.
    At 32:52, when you start the application I get "Unable to obtain connection from database:
    Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections".
    I've copied everything that you did so all the parameters should be fine ( double checked on that ). Is there any chance that you have run into this problem and have an answer to it? Thanks and keep up with the great work!

    • @amigoscode
      @amigoscode  4 года назад +1

      did you configure the db properly?

    • @mariangabrielneacsu4873
      @mariangabrielneacsu4873 4 года назад

      @@amigoscode Yeah followed your same steps on docker

    • @johnaustin4455
      @johnaustin4455 4 года назад

      @@mariangabrielneacsu4873 Seeing this same issue as well. Followed this tutorial a couple weeks ago, and everything worked great. Came back to it a couple days ago, and now I'm seeing the same error. Of note, I also can't connect from the host via pgAdmin or another client. I _can_ connect to postgres from inside the container (via docker exec). So, the container is running. My configuration is exactly as the tutorial lays out. The only variable here seems to be the passage of time.

  • @nthakomotsitsi1365
    @nthakomotsitsi1365 4 года назад

    HI, I man getting error: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource.
    Can you please assist

    • @amigoscode
      @amigoscode  4 года назад

      join the group and we ll help you

  • @sayx18
    @sayx18 4 года назад

    You should really share the code that you show in the video on Github and not a "similar project". And btw, what is Flyway used for in the project? just to create a table?

  • @Deviiie
    @Deviiie 5 лет назад

    So you've build a cloud app?
    Can i build a GUI to it?
    Sorry I'm a Beginner

    • @amigoscode
      @amigoscode  5 лет назад

      Yes. This course amigoscode.com/courses/spring-boot-fullstack

  • @fazlizekiqi2324
    @fazlizekiqi2324 4 года назад

    I cannot connect to the database inside the docker container but when I run manually it works fine. WHY?

  • @RobertTaylor-cg1ll
    @RobertTaylor-cg1ll 4 года назад

    For some reason i keep getting "org.postgresql.util.PSQLException: The connection attempt failed." error

  • @pierretalks949
    @pierretalks949 4 года назад

    mysql vs postgres ?

  • @RendyEzaPutra
    @RendyEzaPutra 5 лет назад

    I got an error that said connection to localhost:5432 refused.
    My environment is Windows 10
    Already set up the firewall to allow port 5432. But I checked on the listening port 'netstat -an' there's no port 5432 alive.
    Though in the docker, port 5432 is alive

    • @amigoscode
      @amigoscode  5 лет назад

      what is using 5432 on the host? You remap if in use. But I doubt, that port is usually set used by Postgres

    • @RendyEzaPutra
      @RendyEzaPutra 5 лет назад

      @@amigoscode okay...
      I stopped the postgre container and run a new one with -p 5432:5444
      and configure the jdbc-url to port 5444
      the result is still connection to localhost:5444 refused

  • @KhaingOfficial
    @KhaingOfficial 4 года назад

    Could you have tutorial of spring boot with JPA?

  • @VicodinMA
    @VicodinMA 5 лет назад

    Hi!
    Where's the link to part 1?
    Thanks

    • @amigoscode
      @amigoscode  5 лет назад

      here: ruclips.net/video/r-6BwGW4Sr8/видео.html

  • @doronsmoliansky7207
    @doronsmoliansky7207 4 года назад

    Caused by: org.flywaydb.core.internal.exception.FlywaySqlException:
    Unable to obtain connection from database: FATAL: role "postgres" does not exist
    even though I have a db in a container running with that role
    >

    • @amigoscode
      @amigoscode  4 года назад

      Can you login using that role using terminal?

    • @Doron193
      @Doron193 4 года назад

      @@amigoscode got it sorted. Had a pg installed on my machine.

  • @dheerajscorefitness6981
    @dheerajscorefitness6981 4 года назад +1

    I am an ardent follower of all your channels
    Please help-
    I am getting the following error when I tryin to connect and create table in AZURE SQL DB through Spring boot --- Error executing DDL "create table model_student (id integer not null, name varchar(255), school_name varchar(255), primary key (id)) type=MyISAM" via JDBC Statement
    I am using this configuration --
    spring.datasource.url=
    spring.datasource.username=
    spring.datasource.password=
    spring.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
    spring.jpa.hibernate.ddl-auto=create
    spring.jpa.show-sql=true
    spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLMyISAMDialect

  • @justaskin3940
    @justaskin3940 5 лет назад

    Seems weird not to have used Spring Tool Suite.

  • @Merlinke91
    @Merlinke91 4 года назад

    For me Hikari... didnt work

  • @yassine212
    @yassine212 5 лет назад

    the links, not works !!

  • @mrTreazy3000
    @mrTreazy3000 4 года назад

    :D

  • @maxtrax3258
    @maxtrax3258 3 года назад

    I do not like this video. The way you show us is far to complicated. You should use Jpa instead. No SQL, no ORM mapper, just annotations in the entity c!ass. And spring generates most of the queries for us too.
    Sorry for that. Like your other videos.

  • @rajithaudayanga6341
    @rajithaudayanga6341 3 года назад

    Please stop saying "and then". It is so boring to hear. otherwise you are a good teacher.