0% found this document useful (0 votes)
5 views8 pages

Www-Runcodes-Tech

Uploaded by

Divyansh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views8 pages

Www-Runcodes-Tech

Uploaded by

Divyansh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

HOME C#.NET PHP JAVA PYTHON ASP.NET VB.

NET ANDROID C MORE  

Home  Programming  JAVA  How to Create User Registration Form in java using MySQL Database?

JAVA

How To Create User Registration Form In Java Using MySQL


Database?
By Er. Ran Bahadur B.K. Last updated Dec 5, 2022

 Share       뀧 12,719  0

In this tutorial we are going to talk about how to create user registration form in java using
MySQL Server database.

If you don’t know how to create login form in java, first of all, you need to read these tutorials:

Login form in java using SQL Server Database: HERE

Login form in java using MySQL Database: HERE

After reading these tutorial, you will understand basics about java, JDK, JRE, environment
variable, required server application etc.

So, i consider that you have the basic knowledge of all these things, and required application
in your system. But specifically, in this tutorial we need these two application.

Download NetBeans IDE: HERE

Download WAMP Server: HERE

STEPS:

[sociallocker]

1.Now open Netbeans IDE and click on file > new project. Select categories as java and project
as java application from that window:
How to Create Login From in Java

2. Click next and then give your project name and then click finished.

3. Now right click on your project and select new > JFrame Form:

4. After this new window will appear from this window drag Panel and extend it, and drag
eight label, seven Text Field, one Button ,one ComboBox and drop to the jframe from.
Change the name of the label to first name, last name, address, gender, email, phone,
username and password. Change the variable name of the Text Field and combo box by right
clicking it and named it as txtfName, txtLname, txtAdd, cmbGender, txtEmail, txtPhone,
txtUser and txtpass respectively. Change the Button text to Register. And right click the
combobox click on properties and click on model, add the item there like Male, Female and
Others etc. which will looks like this:
how to create user registration form in java using mysql database?

5. And finally our login form will looks like the following one:

how to create user registration form in java using mysql database?

6. After download and installing wamp server open it, and then open your localhost, for this
open up your any browsing software and type localhost or 127.0.0.1 in the address bar. Then
new page will appear then scroll down and find phpmyadmin and click on that. Then you will
be able to see the login page. Login in by entering username and password (Default
username is root and password is empty). And then click on new and create one database
having any name you want and the click OK, then create table having eight field in and click on
go. After that, you need to insert the field name like: fname, lname, addr, email, phone,
gender, username and password. and then select the length (like 50, 30, 100 etc) as well as
data type (recommend varchar) as your requirement and then click on save. OR You can
watch the video for this designing part, you may understand better in video.

some screenshot of creating database are:


7. Declare following variable inside the class your jframe, for this select source from the top of
the jframe.

1 Connection con = null;


2 PreparedStatement pst = null;

8. Now double click the Register button and write the following code:

1 try{
2 String query = "INSERT INTO `user`(`fname`, `lname`, `addr`, `gender`, `e
3 con = DriverManager.getConnection("jdbc:mysql://localhost/userregistratio
4 pst=con.prepareStatement(query);
5 pst.setString(1, txtFname.getText());
6 pst.setString(2, txtLname.getText());
7 pst.setString(3, txtAdd.getText());
8 pst.setString(4, cmbGender.getSelectedItem().toString());
9 pst.setString(5, txtEmail.getText());
10 pst.setString(6, txtPhone.getText());
11 pst.setString(7, txtUser.getText());
12 pst.setString(8, txtPass.getText());
13 pst.executeUpdate();
14 JOptionPane.showMessageDialog(null, "REGISTER SUCCESSFULLY");
15
16
17 }catch(Exception ex){
18 JOptionPane.showMessageDialog(null, ex);
19
20 }
9. Now you need to have MySQL connector for java so download it. Click Here and Add this jar
file in your project libraries folder by right clicking libraries >click add jar. Select downloaded
jar file and click open.

10. To run this program you need to right click on your jframe and click run file as below:

Now fill the form and click that register button. That’s it.

If you like this tutorial share this tutorials with your friends or in any java group so that they
will know about this tutorial.

[/sociallocker]

If you are confused then you can watch the following video:

How to Create User Registration Form in java using MySQL Dat…


Dat…
Share
 Create a Registration Form Using Swing Package In Java how to create user registration form in java

how to design login and register form in java netbeans java registration form with mysql database java user registration form

make user registration form in java registration form in java with database connectivity using netbeans

registration form in netbeans with mysql source code for registration form in java netbeans TechSupportNep

user registration form in java

 Share  Facebook  Twitter  ReddIt  뀧 12,719  0

Er. Ran Bahadur B.K. - 81 

Posts - 56 Comments

Ran Bahadur B.K. is the owner of RunCodes who is working with the aim of providing the
quality Technology content. He is creating Tech and Programming videos, you can see all
them in his YouTube Channel(https://www.youtube.com/@RunCodes). He is also working
with some company.

 PREV POST NEXT POST 

How to Create User Registration Form in How to Insert, Delete and Update in SQLite
C#.NET Using SQL Server Database? Database Using Android?

YOU MIGHT ALSO LIKE More From Author

JAVA JAVA JAVA


How to Create a User How to Generate and Send How to Send Free SMS using
Registration Form in Java OTP SMS for Free Using java? Java?[With Source Code]
using MySQL Database? login
and…

 Leave a comment

Need own website, contact me!

Seller
Programming & Tech

Check out my Gigs

RECENT POSTS

How to Create a Banking Application in C#.NET using SQL…


Jun 22, 2024  333  0

How to Create a Calculator App in C#.NET in a easy…


Jun 18, 2024 뀢 528  0
CRUD System in java – How to Insert, Delete,…
Jun 4, 2024  147  0

How to Create a Simple Login Form in VB.NET using…


May 28, 2024  237  0

How to Create a Simple Login Form using java in 2024…


May 21, 2024  125  0

뀀 Facebook
Join us on Facebook 뀁 Twitter
Join us on Twitter 뀈 Youtube
Join us on Youtube

뀘 Instagram
Join us on Instagram

About Us Contact Us Privacy Policy Disclaimer

© 2024 All Rights Reserved.


Website By: Ran Bahadur B.K.

You might also like