If you are workong on many frames you should create connection with database in every class or can you just create a main class and get all data you need for all pages and send it to them ?
Good question! For simplicity and learning purposes in this tutorial, I’ve created the database connection in every class. This way, it's easier to understand how each component works independently. However, in larger projects, it's better to use a single connection manager (like a main class) to handle all database interactions. This avoids creating multiple connections, which can be inefficient. Once you're comfortable with the basics, you can explore techniques like the 'singleton pattern' or connection pooling to optimize performance
I'm sorry if my question sounds dumb and the same. I'm a beginner at using Netbeans. Does it use CRUD, MVC, and mysql? Cause I wanna try using this tutorial for my project.
Not a dumb question at all! 😊 NetBeans is a great IDE for Java development, and it can definitely be used to implement CRUD operations, MVC architecture, and MySQL database connectivity. In this tutorial, we focus on creating a login and register form using MySQL, which involves basic CRUD operations for user management. If you're looking to incorporate MVC into your project, you can structure your code to separate the data handling, user interface, and application logic. This can help make your project more organized and maintainable.
Thank you for this, I can't any tutorial where and how you can connect your java to mysql database! BTW. im using eclipse, where did you get the template base design
thank you Mr. Elias for this piece, I have a worry. I see this error message when I run the code. is it possible to use the code with the version I am using. I really dont want to dowload an older version. please what can I do for it to work? Error: LinkageError occurred while loading main class loginandsignup.LoginAndSignUp java.lang.UnsupportedClassVersionError: loginandsignup/LoginAndSignUp has been compiled by a more recent version of the Java Runtime (class file version 63.0), this version of the Java Runtime only recognizes class file versions up to 60.0.
Thanks for your comment! The UnsupportedClassVersionError indicates that your Java Runtime Environment (JRE) version is older than the version used to compile your code. In your case, it seems like the code was compiled with Java 19 (class file version 63.0), but you’re trying to run it with an older version (Java 16, class file version 60.0). Here are a few options to resolve this: Update Your JRE: The simplest solution is to update your Java Runtime to the same version used to compile the code (Java 19). You can download it from the official Java website. Recompile with an Older Version: If you prefer to stick with your current JRE, you could try recompiling the code with a lower Java version. You can do this in your IDE by setting the project’s JDK to an older version. Use Java Version Compatibility: If you're using an IDE like IntelliJ or Eclipse, you can specify the target version for the compiled classes. This allows your code to be compatible with older JRE versions.
can you like make it so it accept a specific username and password like username is admin and password is 123456 and Login must only accepts 3 attempts and a pop-up message will display to verify the information. If click Yes, it will display the information from the other form called Display Form. (I'm trying to do this task I got in my computer class and idk how, also we're using netbeans too)
How about retrieving name of user bro, i followed your code and its working but if i were click a button and it go to new jframe form then if i exit it back to the jframe form that name is display , it dissappear.
hey this was very much helpful video for my mini project , can u help me find wht i have to do for this error -> " Error!com.mysql.cj.jdbc.Driver " this is getting displayed in the output/terminal , when i try running the sign up page , im not getting the pop up message as well. kindly help if there is any way out.
Well it seems I need to add dependencies (using netbeans 21 and choosen Maven)... Or add the sql declaration in the pom.xml Search in youtube for "Aprenda Como Conectar JAVA com BANCO DE DADOS usando JDBC" for in deep explanation about JDBC connection
it keeps saying "Error!Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server" whenever i run
I had the same issue. You need to connect your database. At the left side of your netbeans you will see 3 windows: Projects|Files|Services 1. Click on services 2. Right click on Databases then choose new connection. *A pop-up window will open* 3. Choose MySQL (connector/J driver) then click next *It will bring you to a window called: Customization Connection* 4. Change the Database to: java_users_database Then you test the connection. If it says connection succeeded then press next. Then press next again then finish. Now, go to your signupbtn code en search for SUrl = "jdbc:MySQL://localhost:3306/java_user_database"; It should be: SUrl = "jdbc:MySQL://localhost:3306/java_users_database"; He mad a typo and put user instead of users.
May God keep blessing all developers who share the source code! You guys are lifesavers! Thank you Elias bro.
Thanks a lot, you saved me from my assignments:)
If you are workong on many frames you should create connection with database in every class or can you just create a main class and get all data you need for all pages and send it to them ?
Good question! For simplicity and learning purposes in this tutorial, I’ve created the database connection in every class. This way, it's easier to understand how each component works independently. However, in larger projects, it's better to use a single connection manager (like a main class) to handle all database interactions. This avoids creating multiple connections, which can be inefficient. Once you're comfortable with the basics, you can explore techniques like the 'singleton pattern' or connection pooling to optimize performance
I'm sorry if my question sounds dumb and the same. I'm a beginner at using Netbeans. Does it use CRUD, MVC, and mysql? Cause I wanna try using this tutorial for my project.
Not a dumb question at all! 😊 NetBeans is a great IDE for Java development, and it can definitely be used to implement CRUD operations, MVC architecture, and MySQL database connectivity. In this tutorial, we focus on creating a login and register form using MySQL, which involves basic CRUD operations for user management.
If you're looking to incorporate MVC into your project, you can structure your code to separate the data handling, user interface, and application logic. This can help make your project more organized and maintainable.
Thank you for this, I can't any tutorial where and how you can connect your java to mysql database!
BTW. im using eclipse, where did you get the template base design
he made it..........
You give the best tutorials
very helpful, thanks sir!
thank you Mr. Elias for this piece, I have a worry. I see this error message when I run the code. is it possible to use the code with the version I am using. I really dont want to dowload an older version. please what can I do for it to work?
Error: LinkageError occurred while loading main class loginandsignup.LoginAndSignUp
java.lang.UnsupportedClassVersionError: loginandsignup/LoginAndSignUp has been compiled by a more recent version of the Java Runtime (class file version 63.0), this version of the Java Runtime only recognizes class file versions up to 60.0.
Thanks for your comment! The UnsupportedClassVersionError indicates that your Java Runtime Environment (JRE) version is older than the version used to compile your code. In your case, it seems like the code was compiled with Java 19 (class file version 63.0), but you’re trying to run it with an older version (Java 16, class file version 60.0).
Here are a few options to resolve this:
Update Your JRE: The simplest solution is to update your Java Runtime to the same version used to compile the code (Java 19). You can download it from the official Java website.
Recompile with an Older Version: If you prefer to stick with your current JRE, you could try recompiling the code with a lower Java version. You can do this in your IDE by setting the project’s JDK to an older version.
Use Java Version Compatibility: If you're using an IDE like IntelliJ or Eclipse, you can specify the target version for the compiled classes. This allows your code to be compatible with older JRE versions.
bro this video is really helpful but can i ask how to code if i want to insert something like Confirm Password in Sign up java
You can, it's actually very easy
yow bro how can i change the email for mine
can i ask where you got the com.mysql.cj.jdbc.Driver in SignUp class? I'm trying to do it I cant use it. Can you help me?
mysql-connector-java:
The Link is under the description
🔥🔥🔥
can you like make it so it accept a specific username and password like username is admin and password is 123456 and Login must only accepts 3 attempts and a pop-up message will display to verify the information. If click Yes, it will display the information from the other form called Display Form. (I'm trying to do this task I got in my computer class and idk how, also we're using netbeans too)
This project is javafx based or javaswing?
@@mercyhuzaifa3411 swing
How about retrieving name of user bro, i followed your code and its working but if i were click a button and it go to new jframe form then if i exit it back to the jframe form that name is display , it dissappear.
Hi bro plss help to connect log in to sql
DOES THIS USE JAVA FX??
hey this was very much helpful video for my mini project , can u help me find wht i have to do for this error -> " Error!com.mysql.cj.jdbc.Driver " this is getting displayed in the output/terminal , when i try running the sign up page , im not getting the pop up message as well. kindly help if there is any way out.
Download the driver the Link is under the description
Having the same error. Already downloaded the driver and add in libraries
Well it seems I need to add dependencies (using netbeans 21 and choosen Maven)... Or add the sql declaration in the pom.xml
Search in youtube for "Aprenda Como Conectar JAVA com BANCO DE DADOS usando JDBC" for in deep explanation about JDBC connection
It is also my problem, i already downloaded the driver, put it in my libraries, butI think, the com.mysql.cj.jdbc.Driver is not related to that
Hi bro. Can you please help me. I used your codes but it said “unknown database (mydatabase name)”.
check the spellings , sorry for the delay
it keeps saying "Error!Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server" whenever i run
I had the same issue.
You need to connect your database.
At the left side of your netbeans you will see 3 windows:
Projects|Files|Services
1. Click on services
2. Right click on Databases then choose new connection.
*A pop-up window will open*
3. Choose MySQL (connector/J driver) then click next
*It will bring you to a window called: Customization Connection*
4. Change the Database to: java_users_database
Then you test the connection.
If it says connection succeeded then press next.
Then press next again then finish.
Now, go to your signupbtn code en search for
SUrl = "jdbc:MySQL://localhost:3306/java_user_database";
It should be:
SUrl = "jdbc:MySQL://localhost:3306/java_users_database";
He mad a typo and put user instead of users.
thanks for the video
You're welcome
el enlace de github no sirve... me sale esto: This is not the web page you are looking for. 😢
Disculpe las molestias, he solucionado el problema. Gracias por tu comentario
do you have one for a forgot password?
Class.forName(className:"com.mysql.cj.jdbc.Driver"); please help me, why i still get an error, i already add in my libraries the connector
Remove class name