Login Page using JSP + Servlet + JDBC + MySQL (2022)- Step by Step Tutorial
Learn how to create a login web application using MySQL+ JSP + Servlet +JDBC (Step by Step). Authenticate the username and password with the table stored in a database.
A Simple Jsp Servlet Jdbc User login page Example using MySQL database, tomcat server, and eclipse. Login using JSP and MySQL.
Step by Step User Login Page tutorial using Jsp, servlets, and database connectivity.
The control goes from the JSP Login page to a servlet on submitting the form. The servlet checks the entered details with the database table. Servlet class contains JDBC code for connecting to MySQL, fetching data, and redirecting users based on input.
Link for downloading Mysql Connector for java: dev.mysql.com/downloads/conne...
This is basic web appication Servlet and JSP.
#servlet #jsp #loginpage #jdbc #mysql #cscornersunitarai
-----------------------------------------------------------------------
Subscribe to my channel for more videos of programming and hit the bell icon to never miss an update in the future.
Also, don't forget to LIKE & COMMENT.
------------------------------------------------------------------------
Channel Subscription:
🔗 / cscornersunitarai
Java Programming Tutorial Playlist
🔗 • Java Programming Tutorial
Advanced Java Tutorial Playlist
🔗 • Advanced Java Tutorial
Thanks for watching my videos till the end, if you like my work please do Subscribe, Like, Comment, and Share!!
------------------------------------------------------------------------
🎥 MY FAVOURITE KZread GEAR
www.amazon.in/shop/cscornersu...
🌍🌍GET Access to KZread Influencer Program Worth 999/- ABSOLUTELY FREE using Coupon🌍🌍
digitalachievershub.com/youtu...
Use this COUPON Code: SPECIALOFFER
------------------------------------------------------------------------
CONNECT WITH ME ON:
►Facebook - / cscornersunitarai
►Personal Facebook A/c - / sunita.sharmarai
►Instagram - / cscornersunitarai
►Telegram - t.me/cscorner
►LinkedIn - / cscornersunitarai
------------------------------------------------------------------------
PS: Some of the links in this description are affiliate links that I get a kickback from
Subscribe to CS Corner Sunita Rai for more videos!
Like! Subscribe! Share!
Stay tuned!
Servlet class example
servlet example program
what is servlet class in Java
what is JSP
JSP example program
MySQL Database
tomcate server
JDBC
Login page using servlet
user login page
A Simple Jsp Servlet Login Example in Tomcat and Eclipse
Create a simple login page using JSP and Servlet
jsp and servlet,jsp,servlet,mysql,login,login using jsp and servlet,login using mysql,tomcat,java,login page in java,how to create login registration form using jsp and mysql,how to create login page in jsp using eclipse,login form in java eclipse with database,how to create registration form in jsp using eclipse,login page in java eclipse,login page in java netbeans,login page using jsp servlet and mysql,login page using jsp and servlet in eclipse,cs corner sunita rai
Пікірлер: 299
*_Got a question on this topic? Please share through comments or reach us on telegram _**_t.me/cscorner_*
@VikasKumar-nb5hv
2 жыл бұрын
Mam I am a beginner . I have no basic knowledge of servlets. So you upload basic lecture on servlets
@sunitarai5174
2 жыл бұрын
@@VikasKumar-nb5hv okay 👍
@alivelupilli8512
Жыл бұрын
I think u entered username and password that username is not there in ur logintable to the database once check it
@JAVA_TECH160
7 ай бұрын
Mam advance java can you develop crud application and mni project
@merugukeerthana9260
5 ай бұрын
Mam I am not getting the option as webapp under src
This is great. Helped me in brushing up my understanding of Java EE code flow. Thanks.
@CSCORNERSunitaRai
20 күн бұрын
Glad you liked my video! Please subscribe
Thank you so much, That's enough for me i will manage the session myself letter...
@CSCORNERSunitaRai
20 күн бұрын
Glad you liked my video! Please subscribe
Your videos helped me every time and this gives me accurate output without any unexpected error. Thanks a lot ma'am 😊
@CSCORNERSunitaRai
Жыл бұрын
That's great☺keep watching
@JAVA_TECH160
7 ай бұрын
@@CSCORNERSunitaRaimam spring basics you cam make video like spring core spring MVC spring jdbc spring aop spring security spring orm
Your tutorial is very helpful, Thanks
@CSCORNERSunitaRai
Жыл бұрын
Glad it was helpful!☺please subscribe👍
Truly Thankful as it helped me
@CSCORNERSunitaRai
Жыл бұрын
You're welcome! Please subscribe
Tq Somuch akka Now understand the servelets andJDBC in Clear , (Chalaa Bagaa Ardam aindhi)
@CSCORNERSunitaRai
20 күн бұрын
Glad you liked my video! Please subscribe
Thank you very much mam, this was a great tutorial for beginners.
@CSCORNERSunitaRai
Жыл бұрын
You're welcome👍
You make hard concept too easy. Thx
@CSCORNERSunitaRai
20 күн бұрын
Glad you liked my video! Please subscribe
really helped a lot❤
Thank you mam. You are explaining the concepts are very good..
@CSCORNERSunitaRai
2 жыл бұрын
Glad you liked it👍 keep watching
thank youuuuu easy and so helpful
@CSCORNERSunitaRai
Жыл бұрын
You're welcome 👍Please subscribe
Good tutorial to learn JSP and sevlets..
@CSCORNERSunitaRai
Жыл бұрын
Thank you so much!
Your Video is helpful till the date. ❤❤
@CSCORNERSunitaRai
Жыл бұрын
Glad you liked it👍☺Please subscribe
Thank you.. i am able to create login page successfully
@CSCORNERSunitaRai
Жыл бұрын
Glad to know that 👍keep watching
Thank you so much maam , it was a much needed
@CSCORNERSunitaRai
Жыл бұрын
You're welcome👍 keep watching
This was very helpful mam. Thanks to you!
@CSCORNERSunitaRai
3 ай бұрын
THANK YOU ! PLEASE SUBSCRIBE ! 🎉🌟
Great job, Sunita.
@CSCORNERSunitaRai
27 күн бұрын
Thank you so much😊
Maam you're awesome! 🥺
@CSCORNERSunitaRai
2 жыл бұрын
☺thank you so much👍keep watching
Thank you mam your video most of the helpful for me.. because i had search this type of video in many of the day but another videos not much clearing my doubt but your video is nice fully explain this concept of authentication purpose.. thank you once again...
@CSCORNERSunitaRai
Жыл бұрын
Glad to hear that☺👍Keep watching
Thank u mam for a wonderful teaching🙏
@CSCORNERSunitaRai
2 жыл бұрын
You're welcome👍
Well explained 👍
@CSCORNERSunitaRai
2 жыл бұрын
Thank you so much👍
You are the best thank you so much
@CSCORNERSunitaRai
9 ай бұрын
You're welcome😊please subscribe👍
mam.. what a explanation!! Thank you soo soo much..
@CSCORNERSunitaRai
10 ай бұрын
You're welcome👍please subscribe😊
THANK YOU !!!!!!!!
@CSCORNERSunitaRai
Жыл бұрын
Glad my video helped you😊Please subscribe
I tried same as you mam and without any errors executed but it always showing else block statements only and if block statements not working can you clarify it once mam
Thank you ma'am 🙏
@CSCORNERSunitaRai
2 жыл бұрын
Keep watching!
Thanks so much!!!!!
@CSCORNERSunitaRai
Ай бұрын
Glad my video helped u! Most welcome 😊Please subscribe
Interesting tutorial
@CSCORNERSunitaRai
2 жыл бұрын
Thank you so much👍
Thank you very much mam ❤
@CSCORNERSunitaRai
Жыл бұрын
You're welcome👍 keep watching
Thank you for your wonderful teaching mam
@CSCORNERSunitaRai
2 жыл бұрын
Glad you liked it👍Do explore my channel for more stuff
@VikasKumar-nb5hv
2 жыл бұрын
I saw your all videos but i need mam beginner videos for servlets
Well explained
@CSCORNERSunitaRai
2 жыл бұрын
Thank you!
Do not skip her steps to add the mysql connector jar to the server in the IDE! After doing that I had a Tomcat caching issue and it would not validate the driver until I ran it a few times and got a new cache with the connector jar in the runtime classpath. Remember, that is runtime classpath, not compile time, and just adding a jar by adding library jars isn't going to work for a servlet.
@CSCORNERSunitaRai
23 күн бұрын
Thanks
Thank you mam 👍🏻🙏🏻
@CSCORNERSunitaRai
11 ай бұрын
Most welcome 😊please subscribe 👍
mam I have selected version 2.5 and it throws an error that version 2.5 was not on java build path. What I have do mam.
Thanks a lot
@CSCORNERSunitaRai
Жыл бұрын
You're welcome👍 keep watching
thank you very much............
@CSCORNERSunitaRai
2 жыл бұрын
You're welcome👍 do explore my channel for more stuffs
nice tutorial
@CSCORNERSunitaRai
2 жыл бұрын
Thank you so much👍
Thank You
@CSCORNERSunitaRai
2 жыл бұрын
You're welcome👍
Thank you so much mam from cdac Pune institute
@CSCORNERSunitaRai
Жыл бұрын
Most welcome 😊please subscribe 👍
Sometime the speed of writing and scrolling is very fast and it become very difficult to see the whole code and when you write code of printwriter at 14.35 minutes of the video one if the portion is not clearly visible. Apart from that it is very helpful
@CSCORNERSunitaRai
Жыл бұрын
Glad it helped you👍 Will take care next time
@siddharthtiwari1515
Жыл бұрын
@@CSCORNERSunitaRai And there is another problem My code isn't successfully run and I am getting a error and I can't review the whole code because in the video I haven't see properly the whole code because it is hidden below on the screen and you don't move page below in the video anywhere.
@CSCORNERSunitaRai
Жыл бұрын
@@siddharthtiwari1515 change speed and watch video if u think so i m going fast.
Thanks mam👍 i just need to ask one question that jar file i moved to Apache server is enough or I need add again in deployment or build path
@CSCORNERSunitaRai
Жыл бұрын
No need.. That's enough
Thank you..
@CSCORNERSunitaRai
Жыл бұрын
You're welcome!
U r great mam ❤
@CSCORNERSunitaRai
11 ай бұрын
It's my pleasure! You're welcome👍 please subscribe 😊
Thank you
@CSCORNERSunitaRai
Ай бұрын
Most welcome 😊Please subscribe
tks so much.
@CSCORNERSunitaRai
Жыл бұрын
You are welcome👍plz subscribe
@ 4:14 I did the same thing, clicked on Organise Import option and yet the errors remain. Error message "The import java.io.IOException cannot be resolved". What can i do about these errors? thankyou
@CSCORNERSunitaRai
6 ай бұрын
Ohk so u r getting error in IO. Please send me pic on my telegram
how to find driver path....line number 21
Please explain one topic -jstl in your series
@CSCORNERSunitaRai
2 жыл бұрын
Ok, noted. Will try
Very nice
@CSCORNERSunitaRai
2 жыл бұрын
Thank you so much👍
Thank you mam
@CSCORNERSunitaRai
Жыл бұрын
Most welcome 😊keep watching
Mam at 1.05 I have the same issue with Jakarta how to solve it mam?.. please help me mam
Very knowledgeable video, thank you so much mam ❤
@CSCORNERSunitaRai
11 ай бұрын
Most welcome 😊please subscribe 👍
Mam, I am facing Description Java compiler level does not match the version of the installed Java project facet issue when trying to run the program.
@CSCORNERSunitaRai
2 жыл бұрын
R u using eclipse IDE? Check compatibility of eclipse ide and jdk
Hello mam From few days facing this issue After downloading mysql connector I don't see executable jar file ..multiple times I downloaded checked every folder but in vain Can u help me get through this
@CSCORNERSunitaRai
2 жыл бұрын
You need to extract it. Check your download folder
I got this error after running on server after writing first program @ login jsp 404 not found The origi server did not find a current representation for the target resource or not willing to disclose that one exists
@CSCORNERSunitaRai
2 жыл бұрын
Make sure your login.jsp is placed in proper directory (webapps)
@saiv5768
2 жыл бұрын
@@CSCORNERSunitaRai k IL try
@BEC-VISHALSR
2 жыл бұрын
@@CSCORNERSunitaRai but also the same problem mam
Thank you ma'am. ma'am is that need to be online......after downloading ......it works for me when i am online?
@CSCORNERSunitaRai
Жыл бұрын
Once you installed it will work offline too
While running jsp page it showing that "the selection is not within a valid module" what I have to do?
@CSCORNERSunitaRai
Жыл бұрын
While creating project select web module 2.5
@user-cs4ej6jm6r
Жыл бұрын
mam I have selected version 2.5 and it throws an error that version 2.5 was not on java build path. What I have do mam.
Thank you for the video. I tried as stated in video... but getting the error ... The requested resource [/Login/] is not available using eclipse EE Version: 2022-09 (4.25.0)
@CSCORNERSunitaRai
7 ай бұрын
Is login is jsp Or servlet?
Thanks mam for great explanation. I am getting class not found exception in this class.forname() line what should I do? And i followed every step.
@CSCORNERSunitaRai
2 жыл бұрын
You're welcome👍 Follow this video to solve error kzread.info/dash/bejne/h65-zMRqYLbScZM.html
Thank you mamm
@CSCORNERSunitaRai
2 жыл бұрын
You're welcome👍 Did it helped you?
@howto4659
2 жыл бұрын
@@CSCORNERSunitaRai yes ma'am🥰🥰
Mam if we use postgresql the same process will be followed for connectivity purpose??
@CSCORNERSunitaRai
2 жыл бұрын
Yes steps are going to same only jdbc driver and connector will change. Download connector for postgresql and use it.
mam as i put username and password and click login button i am getting blank black page as output
@CSCORNERSunitaRai
Жыл бұрын
Check whether u hv entered correct login details or check console id any ereor
Good mam
@CSCORNERSunitaRai
4 ай бұрын
You're welcome!👍Please subscribe 😊
maam like servlet we are using in it, don't we need .xml file to map the servlet????
@CSCORNERSunitaRai
Жыл бұрын
While creating servlet we hv check mark web.xml. So no need to do manual mapping
Hi I have a question. How to add JSTL jar files in Eclipse(2021 version)
@CSCORNERSunitaRai
2 жыл бұрын
You need to paste jstl.jar and standard. jar files to tomcat lib folder
@AlokKumar-fh9gy
2 жыл бұрын
@@CSCORNERSunitaRai thanks Is there any official way to get these? Like any official website
what is this com.mysql.cj.jdbc.Driver which you specified in class parameters
@CSCORNERSunitaRai
7 ай бұрын
This is driver name
in 9:44 , where can i get my my own password?
Thnx
@CSCORNERSunitaRai
4 ай бұрын
You're welcome!👍Please subscribe 😊
@boysrocky5176
4 ай бұрын
@@CSCORNERSunitaRai can u make more videos on this explain jdbc n its classes interfaces in detail
Hi Thanks for your tutorial. What does rs.next() do in above program and which part validates whether user name and password are correct or not?
@CSCORNERSunitaRai
2 жыл бұрын
You're welcome👍 rs.next() moves your cursor to point to your records
hi mam how to create registration page without register.dao?
Thanks madam
@CSCORNERSunitaRai
Жыл бұрын
You’re welcome 😊
Hello Ma'am actually Im facing troble to add mysql connector in server runtime so can i add connector in classpath.
@CSCORNERSunitaRai
5 ай бұрын
U can add to lib folder
hi mam, i want to print jsp page input field in my java class... using textfield name attribute am accessing it in request object in java class by request.getParamter() method but for all input it prints null in backend....how to fix this issue(request...httpservletrequest object)
@CSCORNERSunitaRai
Жыл бұрын
java program means swing based application? request and response concept comes in web application not desktop
How can I copy my connector jar file into this I think its not ideal way of doing this in your video
@CSCORNERSunitaRai
6 ай бұрын
What is wrong in this? We're just pasting required file onto server. There are different ways of doing this pgm, I have shown the simplest way which beginner can understand
have followed your video but when trying to run on server i am getting error as class not found exception request you to plz guide me
@CSCORNERSunitaRai
Жыл бұрын
Did you added connector. jar
my servlet page not working is show a error in resource not avilable in Login project
@CSCORNERSunitaRai
Жыл бұрын
Join my telegram, I have shared source code, check file section
Hi Mam.. can you please make the same project using maven and hibernate along with jsp and servlet? I have searched everywhere and could not find one in updated format.
@CSCORNERSunitaRai
8 ай бұрын
I'll try
@dancebattleangelwithprophe9881
8 ай бұрын
@@CSCORNERSunitaRai thankyou
Hello mam, After user login when I enter name and password. When I clicked login button it not showing welcome.jsp Or login failed try again page. What should I do for solving this error?
@CSCORNERSunitaRai
2 жыл бұрын
Please check action attribute of form tag. Also make sure your jsp Or html files are under webapp
@sankalpakuldharan1384
2 жыл бұрын
Mam, now it's working. But showing only login failed page for every input, not displayed welcome.jsp file for correct username and password.
@ybsigma3317
2 жыл бұрын
@@sankalpakuldharan1384 1. go to the folder where the mysql connector jar file is located (Probably downloads) 2. Drag the jar file and drop it into WEB-INF/lib folder of your project
@studentimantha5345
Жыл бұрын
@@ybsigma3317 I get this error too. Now I fixed it thank you!
@gopikrishnan6667
Жыл бұрын
@@ybsigma3317 thanks
hello sir ,I am trying to this form but i am face a error.so please solve it . Cannot invoke "java.sql.Connection.prepareStatement(String)" because "con" is null
@CSCORNERSunitaRai
Жыл бұрын
Check import for Connection, it should be java.sql.Connection. Also check declaration of connection object
when i clicked on organise imports nothing happened and errors weren't fixed 4:17
@CSCORNERSunitaRai
11 ай бұрын
Then u can import manually
hey, when you successfully logged in, why didn't url name change to welcome.jsp But when you started server it was showing login.jsp Although this might be silly question but I am new to Java
@CSCORNERSunitaRai
7 ай бұрын
It's not a silly question 😊 This is due to the method which I have used
Mam can you please create same project on visual studio please update thanks
Hi Sunita, I am from England. I left programming about 15 years ago. Forgotten every thing, reviving my memories. Where can I reach you in case of any queries. thanks and regards.
@CSCORNERSunitaRai
6 ай бұрын
U can send messages on my telegram
Even after organising imports, the errors are still there
@CSCORNERSunitaRai
9 ай бұрын
What error u r getting?
After executing the code loginsevlet page showing empty blank page. Nothing is visible...
@CSCORNERSunitaRai
8 ай бұрын
If this is the case then check getParameter method. did u wrote write textbox name
hello Ma'am, when I'm running my program I'm getting this error HTTP Status 405 - Method Not Allowed Type Status Report Message HTTP method GET is not supported by this URL Description The method received in the request line is known by the origin server but not supported by the target resource. please help me . I'm stuck here ...i can't go any further
Ma'am, I know how to fetch data from Database. But those data, how to pass to JSP page for displaying purpose. That I do not know. Can u make video on that
@CSCORNERSunitaRai
Жыл бұрын
yes I'll. If u can share your requirement exactly
@manukm5510
Жыл бұрын
@@CSCORNERSunitaRai Exactly like CRUD operation. But I didn't use bean class for writing JDBC code and also I wrote JDBC code in Servlet class only. By using ResultsSet Interface I was fetching the data and I can print it on UI using PrintWriter class. But I want to create separate JSP file for displaying purpose. So how can I pass those output data of JDBC to JSP to print it on to the UI. If you can able to give your Email ID. I will send my through Email.
i want to send response on same login page without using jsp
@CSCORNERSunitaRai
10 ай бұрын
use include action or directive or requestdispatcher include method
mam can we store the inputs like name, mail in jsp page in Mysql database?
@CSCORNERSunitaRai
Жыл бұрын
Yes yes
@-Corvo_Attano
Жыл бұрын
@@CSCORNERSunitaRai i just modified the code to store the html inputs in Mysql database. Thanks for this Video mam :) Thanks for your explanation ♥
I am not getting the option dynamic web project
@CSCORNERSunitaRai
Жыл бұрын
Did you changed perspective? Change from java to java ee
Mam servelt is running successfully but I can't get the login successfully page after submit
@CSCORNERSunitaRai
Жыл бұрын
Check your database connectivity
hi mam, great tutorial but I was running into an issue, I got Login failed for every input
@CSCORNERSunitaRai
2 жыл бұрын
Is the connection established successfully? Check your table name and column name. Also check whether you have data in table or not
@akshattiwari5495
2 жыл бұрын
@@CSCORNERSunitaRai I checked mam, the issue has now been resolved, thankyou.
@CSCORNERSunitaRai
2 жыл бұрын
@@akshattiwari5495 great
HTTP Status 404 - Not Found Type Status Report Message The requested resource [/LogingPageTest/LoginServlet] is not available Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. Apache Tomcat/9.0.85
@CSCORNERSunitaRai
4 ай бұрын
Check my tomcat tutorial
@theundesirableone-sw9mm
3 ай бұрын
Is it resolved to you. I am getting the same error
now i am running login.jsp file but it says HTTP status not found---what is the solution for this
@CSCORNERSunitaRai
Жыл бұрын
Did you kept your jsp file in web apps folder
@kanalaranganadhreddy2133
Жыл бұрын
Yess mam
maam the printwriter line is not visible can u please tell what is was 14:30
@CSCORNERSunitaRai
11 ай бұрын
PrintWriter out=response.getWriter();
i put the correct username and password and i get a blank page . i can call both login and welcome files just fine.
@Calvin-rt2ls
4 ай бұрын
make sure you put the jar file in the tomcat lib folder
Hi...maam..gud afternoon.....I have a doubt on connections....how to check path,protocol,localhost..
@CSCORNERSunitaRai
2 жыл бұрын
Localhost and protocol is going to remain same. Only you have to check port number. U can login to mysql command line and can check.
After login its showing blank page what is the error in that mam
@bannubenz6245
7 ай бұрын
Me to if you found error please share me
@sourabhsingh8346
5 ай бұрын
Because there is no content in home page 😅
Will u plz provide a code when we will add user name and password and click on login button it should get stored in database and display msg login successfully
@CSCORNERSunitaRai
Жыл бұрын
Join my telegram.. Already shared
@khushimulla8363
Жыл бұрын
Ok