Connect MySQL to Java in IntelliJ 2024 | Full JDBC Tutorial for DB Connectivity
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
Simple and straight forward video in a highly digestible format.
Thank you!
No problem! Glad it helped, and thanks 😀
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.
Thanks! I appreciate your comment 😀
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!
Glad to help 😀
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 :'''')
No problem, glad it helped 😀
thank you so much, keep it up
Thanks!, glad it helped 😀
Thankyou for helping my assignment.
Subsribed 🎉
No problem, glad it helped 😀
thank you so much dude! very nice video
No problem, glad it helped 😀
nice useful for me and keep posting video's like this ...
Thanks, glad it helped 😃. And will do
a life saver
Glad it helped 😀
thanks for the simple explanation
Glad to help 😀
thanks for the help
No problem, glad it helped 😀
good way of teaching easy-to understand
Thanks, glad it helped 😀
tyvm mate
No problem, glad it helped 😀
YOUR MY GOAT TY
Glad you found my video helpful 😀
THANK YOU
Glad to help 😀
thank you 😊
No problem 😀
Good lesson
Thanks 😀
Thanks a lot men
No problem 😀
thanks!!
No problem! Glad it helped 😀
Thanks hope I can get this right
No problem, and you will 😎
thanks
No problem, glad it helped 😁
Thank you
No problem 😀
kudos from brazil
Thanks!
For me is very important this video, because I usually delete my DataBase
Thanks! Glad you found it helpful 😀
I LOVE NEEJAY
Conseguir entender perfeitamente, me ajudou demais
Thanks! Glad it helped 😃
Very nice video. Could you make a SpringBoot tutorial?
I appreciate it 🙏. I only know a little bit about springboot, but I'll consider it in the future 😅
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
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
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?
I am not too familiar with Kafka or PostgresSQL, but possibly in the future when I have time to learn it 😃
Thank you 🌹
And how to connect more than 2 pcs with the same database
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 👍
Hello please make a video on Tomcat configuration with intellij ide
I'll consider it, but from what I've seen it seems like I'll need a paid version of IntelliJ to do that
Bro but i m not getting the jar file after extracting it
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?
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.
straight way do some java project for us pls
Hello, I do have Java projects in my channel if you want to check them out 😀
YOU KNOW I KNOW .............
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?
Hello, which part are you in that you are experiencing this error? Are you having problems creating the schema?
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
@@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.
I cannot use my connectivity port because already use
How can i make it unused
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.
I'm using eclipse and it says Access denied for user 'root'@'localhost' (using password: YES) any solutions??
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.
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
@@pancake4691 No worries, and yeah after rewatching I should've been more specific about it in the video 😅
why you could not use maven intellj
Oh yeah it is another way of doing it. I might consider making one for those that are using Maven
HIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
5:05 SELECT * FROM USERS LIMIT 0,1000 and its an error... why .. i did the same then you...
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
Access denied for user 'root'@'localhost' (using password: YES)
......
..
pls help
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
Hey in mySQL the SELECT * FROM USERS ; Can't work
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"
Thank you @@TapTap_196
BYE UNCLE
zoom in ? can't see anything....
Yeah this is an issue with my older video, but I'm still trying to improve 😅
IM SLEEPY
BECAUSE OF THIS VIDEO
was to fast you skip so much .. i can´t follow you at the itellij think wtf...
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
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
bro can you speak more quietly so we can't hear you at all!!!!!!
Apologies I was still new to video editing, but I take this into consideration in my current videos.
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
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.