Connect MySQL to Java in IntelliJ 2024 | Full JDBC Tutorial for DB Connectivity

Sdílet
Vložit
  • čas přidán 27. 07. 2024
  • In this Java tutorial, I'll show you step-by-step how to connect a MySQL database to your Java application in IntelliJ IDEA 2023 Easily and Quickly
    🔴 Subscribe for more ASMR programming videos like this: czcams.com/channels/MHL.html...
    I'll start by downloading, installing, and configuring MySQL Server and MySQL Workbench. Then we'll create a simple database and test the connection.
    Next, I'll demonstrate using the MySQL Connector/J JDBC driver to establish connectivity between IntelliJ IDEA and MySQL. I'll show you how to add the dependency, create the connection string, and write Java code to connect to the database.
    MySQL Server and Workbench:
    dev.mysql.com/downloads/insta...
    MySQL Connector:
    dev.mysql.com/downloads/conne...
    ⏲ Timestamp:
    00:00 - 00:08: Intro
    00:08 - 00:31: Downloading MySQL Server and Workbench Installer
    00:32 - 01:48: Configuring Installation
    01:49 - 02:30: Creating a Schema in Workbench
    02:31 - 04:00: Creating SQL Table in Workbench
    04:01 - 04:52: Inserting data to our Table
    04:53 - 05:11: Checking Insert Data
    05:12 - 06:06: Downloading MySQL Connector JAR File
    06:07 - 07:13: Configuring JAR File to Project (IntelliJ)
    07:14 - 10:18: Creating Example Project
    10:19 - 11:04: Demo + Outro
    See more of my content below:
    🩳 Shorts Playlist: • Shorts
    ☕ Java Playlist: • Java Swing Series
    🍵 JavaFX Playlist: • JavaFX Series
    ------------------------------SOCIAL------------------------------
    📹 Checkout my ASMR studying channel: / @taptapstudyi. .
    🐱‍🚀 Github: github.com/curadProgrammer
    ----------------------------Keyboard Specs----------------------------
    MageGee 60% Mechanical Keyboard
    Tape Mod
    Foam Mod
    Akko CS Jelly Black Switches (Lubed with 205g0 Krytox)
    PBT DYE-SUB Keycaps
    Extra Tags:
    ASMR Programming, ASMR Coding, ASMR keyboard typing, ASMR Java, No Talking Coding, No Talking, No talking programming, no talking asmr, no talking asmr keyboard, Java Project, Login application, Swing Library, Swing Framework, Software Engineer, Software Developer, Graphical User Interface, asmr programming java, java gui, java coding asmr, coding no talking, programming no talking, speed coding, intellij idea, keyboard asmr, mechanical keyboard asmr, mechanical keyboard for programming, programming asmr no talking, swing gui, tutorial, asmr tutorial, MySQL, MySQL Workbench, MySQL Server installation, MySQL Server
    #MySQL #Java #IntelliJ #JDBC #Database #Connectivity #Tutorial #Coding #Programming #DatabaseConnection #MySQLWorkbench #MySQLConnector #CRUD #Insert #Update #Delete #Query #Beginner #Newbie #IDE #Integrate
  • Jak na to + styl

Komentáře • 100

  • @freytryggvason5488
    @freytryggvason5488 Před 4 měsíci +4

    Simple and straight forward video in a highly digestible format.
    Thank you!

    • @TapTap_196
      @TapTap_196  Před 4 měsíci +1

      No problem! Glad it helped, and thanks 😀

  • @SifatUllah-12
    @SifatUllah-12 Před 2 měsíci +2

    What! I literally have been searching for this exact topic, and your video came right up. Easy, straight forward, and easily one of the best videos to understand in one go. You're becoming my favorite java content creator and you're so underrated.

    • @TapTap_196
      @TapTap_196  Před 2 měsíci

      Thanks! I appreciate your comment 😀

  • @heine9257
    @heine9257 Před měsícem +1

    Thank you very much! i never comment on any yt video, but wanted to thank you for your helpful videos on java, it is very much appriciated, you are talented!

  • @DerLucht
    @DerLucht Před 2 měsíci +1

    Thank you SO DAMN MUCH, I've literally been on the edge of desparation and I finally managed to do everything right, OH GOD thank you sir :'''')

    • @TapTap_196
      @TapTap_196  Před 2 měsíci +1

      No problem, glad it helped 😀

  • @user-dw4xp8ep1p
    @user-dw4xp8ep1p Před 10 měsíci +2

    thank you so much, keep it up

    • @TapTap_196
      @TapTap_196  Před 10 měsíci

      Thanks!, glad it helped 😀

  • @generate-your-ip
    @generate-your-ip Před 26 dny

    Thankyou for helping my assignment.
    Subsribed 🎉

  • @papimar2441
    @papimar2441 Před 3 měsíci

    thank you so much dude! very nice video

    • @TapTap_196
      @TapTap_196  Před 3 měsíci

      No problem, glad it helped 😀

  • @satmar1331
    @satmar1331 Před 8 měsíci

    nice useful for me and keep posting video's like this ...

    • @TapTap_196
      @TapTap_196  Před 8 měsíci +1

      Thanks, glad it helped 😃. And will do

  • @dxtfps
    @dxtfps Před 10 měsíci

    a life saver

  • @kaustubhmahajan239
    @kaustubhmahajan239 Před 2 měsíci

    thanks for the simple explanation

  • @abdullaharif2492
    @abdullaharif2492 Před 7 měsíci

    thanks for the help

    • @TapTap_196
      @TapTap_196  Před 7 měsíci

      No problem, glad it helped 😀

  • @TheDarkSide2003
    @TheDarkSide2003 Před 3 měsíci

    good way of teaching easy-to understand

  • @walterjocoski
    @walterjocoski Před 2 měsíci

    tyvm mate

    • @TapTap_196
      @TapTap_196  Před 2 měsíci

      No problem, glad it helped 😀

  • @numnuggettwin6515
    @numnuggettwin6515 Před 6 měsíci

    YOUR MY GOAT TY

    • @TapTap_196
      @TapTap_196  Před 6 měsíci

      Glad you found my video helpful 😀

  • @numberzero6833
    @numberzero6833 Před 2 měsíci

    THANK YOU

  • @MicheleWM5
    @MicheleWM5 Před 5 měsíci

    thank you 😊

  • @sqcristal8417
    @sqcristal8417 Před 11 měsíci

    Good lesson

  • @Rikkivlogs68
    @Rikkivlogs68 Před 3 měsíci

    Thanks a lot men

  • @adelingt
    @adelingt Před 2 měsíci

    thanks!!

    • @TapTap_196
      @TapTap_196  Před 2 měsíci

      No problem! Glad it helped 😀

  • @alucard2477
    @alucard2477 Před 2 měsíci

    Thanks hope I can get this right

    • @TapTap_196
      @TapTap_196  Před 2 měsíci

      No problem, and you will 😎

  • @modelschoolgohad6601
    @modelschoolgohad6601 Před 3 měsíci +1

    thanks

    • @TapTap_196
      @TapTap_196  Před 3 měsíci

      No problem, glad it helped 😁

  • @YohannesAssefa-wk5oo
    @YohannesAssefa-wk5oo Před 6 měsíci

    Thank you

  • @felipeborges474
    @felipeborges474 Před 2 měsíci

    kudos from brazil

  • @tavo8632
    @tavo8632 Před 4 měsíci +1

    For me is very important this video, because I usually delete my DataBase

    • @TapTap_196
      @TapTap_196  Před 4 měsíci

      Thanks! Glad you found it helpful 😀

  • @ajaykumar.d958
    @ajaykumar.d958 Před 7 měsíci

    I LOVE NEEJAY

  • @thiagofonseca1649
    @thiagofonseca1649 Před 9 měsíci

    Conseguir entender perfeitamente, me ajudou demais

  • @vledolf1573
    @vledolf1573 Před 11 měsíci

    Very nice video. Could you make a SpringBoot tutorial?

    • @TapTap_196
      @TapTap_196  Před 11 měsíci +2

      I appreciate it 🙏. I only know a little bit about springboot, but I'll consider it in the future 😅

  • @mekvil1337
    @mekvil1337 Před 3 měsíci +1

    Hello, i have problem that everything works fine in Intellj idea, but if i export the jar file with dependecies mysql it says java.sql.SQLException: No suitable driver found for

    • @TapTap_196
      @TapTap_196  Před 3 měsíci

      Hello are you using maven for your project? If so maybe try adding it as a dependency instead of as an external JAR.
      mysql
      mysql-connector-java
      8.0.33

  • @MWNCorp
    @MWNCorp Před 11 měsíci

    Hallo Sir, Can you create a stylish tutorial for a Java connector to Kafka in the form of a JAR, enabling seamless connectivity to a PostgreSQL database?

    • @TapTap_196
      @TapTap_196  Před 11 měsíci +1

      I am not too familiar with Kafka or PostgresSQL, but possibly in the future when I have time to learn it 😃

  • @musabnet
    @musabnet Před měsícem

    Thank you 🌹
    And how to connect more than 2 pcs with the same database

    • @TapTap_196
      @TapTap_196  Před měsícem

      No problem, glad it helped 😀.
      Hmm...I'm not exactly sure but if you are trying to make it so that they connect to your MySQL server you can try this phoenixnap.com/kb/mysql-remote-connection
      Alternatively, you can try find a hosting site to host your MySQL database like Render: docs.render.com/deploy-mysql and you wouldn't need to create your own server and the other pc can connect to the hosting site's servers instead which might be safer.
      Hopefully this helps, and good luck 👍

  • @rudreshrathod2211
    @rudreshrathod2211 Před 10 měsíci

    Hello please make a video on Tomcat configuration with intellij ide

    • @TapTap_196
      @TapTap_196  Před 10 měsíci

      I'll consider it, but from what I've seen it seems like I'll need a paid version of IntelliJ to do that

  • @cadetharshit6833
    @cadetharshit6833 Před 19 dny

    Bro but i m not getting the jar file after extracting it

  • @erickboneti4175
    @erickboneti4175 Před 3 měsíci

    For some reason even after adding the jar file, the imports still doesn't work, so i have to add "requires java.sql" to module.info.java, i don't get it, could someone help me?

    • @TapTap_196
      @TapTap_196  Před 3 měsíci

      Hello, are you using JavaFX by chance? If so, then you will also need to add the requires java.sql in the module.info.java file.

  • @TheDarkSide2003
    @TheDarkSide2003 Před 3 měsíci

    straight way do some java project for us pls

    • @TapTap_196
      @TapTap_196  Před 3 měsíci

      Hello, I do have Java projects in my channel if you want to check them out 😀

  • @ajaykumar.d958
    @ajaykumar.d958 Před 7 měsíci

    YOU KNOW I KNOW .............

  • @InesKetata
    @InesKetata Před 4 měsíci

    hi , i have a problem database is not created in my sql i have tried to resolve this problem but it's not working what should i do?

    • @TapTap_196
      @TapTap_196  Před 4 měsíci

      Hello, which part are you in that you are experiencing this error? Are you having problems creating the schema?

    • @christianmendoza7085
      @christianmendoza7085 Před měsícem

      I have the same problem , I put run database but still at the end in the Java file it runs an error at result set due to it not finding the symbol

    • @TapTap_196
      @TapTap_196  Před měsícem

      @@christianmendoza7085 ​ Hello, could you paste in the error that you are getting? Also can you tell me what part of the video you are on?
      Make sure that the column-id you pass in the "resultSet.getString("column-id")" that it matches with what you created in the database schema.

  • @nurzulaikha1624
    @nurzulaikha1624 Před 7 měsíci

    I cannot use my connectivity port because already use
    How can i make it unused

    • @TapTap_196
      @TapTap_196  Před 7 měsíci

      Hello are you referring to this part @1:10?
      I'm unfortunately not too familiar with changing the MySQL settings, but this might help you out: stackoverflow.com/questions/29866204/how-to-change-the-default-port-of-mysql-from-3306-to-3360
      Let me know if it helps.

  • @oknowu8824
    @oknowu8824 Před měsícem

    I'm using eclipse and it says Access denied for user 'root'@'localhost' (using password: YES) any solutions??

    • @TapTap_196
      @TapTap_196  Před měsícem

      Hello, could you tell me which part you are at?
      Also make sure that the password you are using is the same one you created @1:17.

    • @pancake4691
      @pancake4691 Před 16 dny

      I get the same message when I run it but I am using intelliJ . Idk what went wrong since I copied every step
      edit: I fixed it by putting my password I created earlier at 1:17 like Tap said, I somehow did not hear the part where you said to use the password you created earlier and just copied your "password" on accident in the code section at 8:43 lol

    • @TapTap_196
      @TapTap_196  Před 15 dny

      @@pancake4691 No worries, and yeah after rewatching I should've been more specific about it in the video 😅

  • @user-vm1iy4rg5z
    @user-vm1iy4rg5z Před 2 měsíci

    why you could not use maven intellj

    • @TapTap_196
      @TapTap_196  Před 2 měsíci

      Oh yeah it is another way of doing it. I might consider making one for those that are using Maven

  • @ajaykumar.d958
    @ajaykumar.d958 Před 7 měsíci

    HIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII

  • @dermagier4942
    @dermagier4942 Před 6 měsíci

    5:05 SELECT * FROM USERS LIMIT 0,1000 and its an error... why .. i did the same then you...

    • @TapTap_196
      @TapTap_196  Před 6 měsíci

      Hello, what type of error did you get? Make sure to highlight the schema you are working on by double clicking it. The schema should be bolded

  • @sathstud
    @sathstud Před 6 dny

    Access denied for user 'root'@'localhost' (using password: YES)
    ......
    ..
    pls help

    • @TapTap_196
      @TapTap_196  Před 6 dny

      Hello, did you make sure to use your password that you created during the setup? If not then try to use your password instead of the one in the video.
      If this isn't it, try this solution: stackoverflow.com/questions/41645309/mysql-error-access-denied-for-user-rootlocalhost
      Hopefully this helps

  • @manzialvinthierry
    @manzialvinthierry Před 2 měsíci

    Hey in mySQL the SELECT * FROM USERS ; Can't work

    • @TapTap_196
      @TapTap_196  Před 2 měsíci +2

      Hello, you might need to add in the schema before users. So if you are using the same schema in the video try "SELECT * FROM login_schema.USERS"

    • @oknowu8824
      @oknowu8824 Před měsícem

      Thank you ​@@TapTap_196

  • @ajaykumar.d958
    @ajaykumar.d958 Před 7 měsíci

    BYE UNCLE

  • @rdxdevil5083
    @rdxdevil5083 Před 3 měsíci

    zoom in ? can't see anything....

    • @TapTap_196
      @TapTap_196  Před 3 měsíci +1

      Yeah this is an issue with my older video, but I'm still trying to improve 😅

  • @ajaykumar.d958
    @ajaykumar.d958 Před 7 měsíci

    IM SLEEPY

  • @dermagier4942
    @dermagier4942 Před 6 měsíci

    was to fast you skip so much .. i can´t follow you at the itellij think wtf...

    • @TapTap_196
      @TapTap_196  Před 6 měsíci +1

      Hello. If you find the video too fast, you might want to consider adjusting the playback speed to 0.75 or 0.5. Hopefully this helps

    • @dermagier4942
      @dermagier4942 Před 6 měsíci

      Regarding the transition to IntelliJ, I’m not understanding how you obtained this folder/ project 6:09. When I open mine, I don’t see anything similar. Consequently, at 10:20, I’m encountering a million errors and ‘e.printStackTrace()’ is underlined in yellow.” @@TapTap_196

  • @makarovgregoir1446
    @makarovgregoir1446 Před 21 dnem

    bro can you speak more quietly so we can't hear you at all!!!!!!

    • @TapTap_196
      @TapTap_196  Před 20 dny +1

      Apologies I was still new to video editing, but I take this into consideration in my current videos.

  • @Saiyan412
    @Saiyan412 Před měsícem

    This is one of your easiest tutorial, better than that weather gui😂but still i faced problem, showing error after running code on intelij idea,it showed , 1 - SQLException
    2 - SQLError.java:121
    3- SQLExceptionmapping.java:113
    4-connectionImpl.java:449
    5-connectionImpl.java:234
    6-NonregisteringDriver.java:100
    7-DriverManager.java:682
    8-DriverManager.java:230
    All these errors at once

    • @TapTap_196
      @TapTap_196  Před měsícem

      Hello, did you place the JDBC JAR in the project structure around @7:13? I'm thinking that is what is causing the issue as the JAR is used to connect to the MySQL Database.