How to connect HTML Form with MySQL Database using JSP | Registration Page Example

preview_player
Показать описание
In this video I have shown you How to connect the HTML registration form with mysql database using JSP.

code of this video
-----------------------------
-----------------------------------------------------------
Angle brackets are not allowed that is the reason I have pasted only try block code here
-----------------------------------------------------------

How to Create a HTML Registration Form using bootstrap

This video I have maded into two parts
2. How to connect HTML Form with #MySQL database using #JSP

The First thing we have to do is to create a folder structure. The folder structure for JSP and servlet is same
--ROOT
----src
----WEB-INF
------classes
------lib
Inside the root folder minimum WEB-INF folder should be there and inside WEB-INF minimum one folder should be there which is lib
lib - folder is required for external library file in this video we need connector library.
once done then we can create html and jsp file inside the root folder

In this example we are using MySql as the database. So we need to know following informations for the mysql database:

Connection URL: The connection URL for the mysql database is jdbc:mysql://localhost:3306/test where jdbc is the API, mysql is the database, localhost is the server name on which mysql is running, we may also use IP address, 3306 is the port number and test is the database name. We may use any database, in such case, you need to replace the test with your database name.
Username: The default username for the mysql database is root.
Password: The default password for the mysql database is ""(blank).Password is given by the user at the time of installing the mysql database. In this example, we are going to use "" as the password.
Let's first create a table in the mysql database, but before creating table, we need to create database first.

create database test;
Рекомендации по теме
Комментарии
Автор

Sorry guyzz the query is not properly visible in video. So here I am pasting that query

PreparedStatement ps = conn.prepareStatement("insert into registration(firstName, lastName, gender, email, password, number) values(?, ?, ?, ?, ?, ?);");

TechnicalBabaji
Автор

Bro, Thank you so much. This is a video which really helped me!!!! Your subscriber from Ukraine

seattlemusic
Автор

do you have any playlist for connecting HTML CSS js with backend java and mysql

zainwasem
Автор

Thank you sir for such fabulous explanation ☺️

hemnaik
Автор

Sir, my connect.jsp file is in text format.So, data is not getting entered into thte database!...

bvocalz
Автор

Registration with mobile number and login with same mobile number with otp conformation in spring boot with database?, will you please tell a class for my question.

manojkumarreddy
Автор

its not working..this is wht i needed write now..but localhost is not finding my page :(((

bareen
Автор

I have run the same code but i am getting error page not found.could you help me to solve this problem

hemapriya
Автор

Nice tutorial, Well explained and Works fine !!

yudhishkumar
Автор

Sir after submitting my html form my jsp file ie the jsp code is displaying.What error is it?

abinayamani
Автор

what about the on click submit button event

sidduhiremath
Автор

Thank you! Very good Job... it helped me!

paulosergioborges
Автор

i have problem with your lines 14-19. "firstname cannot be resolved to a variable".

azakoo
Автор

I have xampp server so how to connect with database

hacikmohamed
Автор

I have problem that html file is not opening using localhost can you resolve it

pravallikavasa
Автор

Hi Sir.. I am getting error "connection cannot be resolved to a type".. please help

yogeshnirmal
Автор

http error 4040 fount that connection.jsp not found what to do

KrishnaSharma-ocuj
Автор

i didn't found apche software foundation

sasisasi
Автор

Sir, How to made a Login Page with Email and password which helps us to log in after we registered.Please help.

aniketjaiswal
Автор

Sir can you please provide source code

charanreddy