Login Page using JSP + Servlet + JDBC + MySQL (2022)- Step by Step Tutorial
Vložit
- čas přidán 27. 07. 2024
- 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 CZcams GEAR
www.amazon.in/shop/cscornersu...
🌍🌍GET Access to CZcams 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
*_Got a question on this topic? Please share through comments or reach us on telegram _**_t.me/cscorner_*
Mam I am a beginner . I have no basic knowledge of servlets. So you upload basic lecture on servlets
@@VikasKumar-nb5hv okay 👍
I think u entered username and password that username is not there in ur logintable to the database once check it
Mam advance java can you develop crud application and mni project
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.
Glad you liked my video! Please subscribe
Thank you so much, That's enough for me i will manage the session myself letter...
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 😊
That's great☺keep watching
@@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
Glad it was helpful!☺please subscribe👍
Truly Thankful as it helped me
You're welcome! Please subscribe
Tq Somuch akka Now understand the servelets andJDBC in Clear , (Chalaa Bagaa Ardam aindhi)
Glad you liked my video! Please subscribe
Thank you very much mam, this was a great tutorial for beginners.
You're welcome👍
You make hard concept too easy. Thx
Glad you liked my video! Please subscribe
really helped a lot❤
Thank you mam.
You are explaining the concepts are very good..
Glad you liked it👍 keep watching
thank youuuuu easy and so helpful
You're welcome 👍Please subscribe
Good tutorial to learn JSP and sevlets..
Thank you so much!
Your Video is helpful till the date. ❤❤
Glad you liked it👍☺Please subscribe
Thank you.. i am able to create login page successfully
Glad to know that 👍keep watching
Thank you so much maam , it was a much needed
You're welcome👍 keep watching
This was very helpful mam. Thanks to you!
THANK YOU ! PLEASE SUBSCRIBE ! 🎉🌟
Great job, Sunita.
Thank you so much😊
Maam you're awesome! 🥺
☺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...
Glad to hear that☺👍Keep watching
Thank u mam for a wonderful teaching🙏
You're welcome👍
Well explained 👍
Thank you so much👍
You are the best thank you so much
You're welcome😊please subscribe👍
mam.. what a explanation!!
Thank you soo soo much..
You're welcome👍please subscribe😊
THANK YOU !!!!!!!!
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 🙏
Keep watching!
Thanks so much!!!!!
Glad my video helped u!
Most welcome 😊Please subscribe
Interesting tutorial
Thank you so much👍
Thank you very much mam ❤
You're welcome👍 keep watching
Thank you for your wonderful teaching mam
Glad you liked it👍Do explore my channel for more stuff
I saw your all videos but i need mam beginner videos for servlets
Well explained
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.
Thanks
Thank you mam 👍🏻🙏🏻
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
You're welcome👍 keep watching
thank you very much............
You're welcome👍 do explore my channel for more stuffs
nice tutorial
Thank you so much👍
Thank You
You're welcome👍
Thank you so much mam from cdac Pune institute
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
Glad it helped you👍
Will take care next time
@@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.
@@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
No need.. That's enough
Thank you..
You're welcome!
U r great mam ❤
It's my pleasure!
You're welcome👍 please subscribe 😊
Thank you
Most welcome 😊Please subscribe
tks so much.
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
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
Ok, noted. Will try
Very nice
Thank you so much👍
Thank you mam
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
❤
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.
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
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
Make sure your login.jsp is placed in proper directory (webapps)
@@CSCORNERSunitaRai k IL try
@@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?
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?
While creating project select web module 2.5
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)
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.
You're welcome👍
Follow this video to solve error
czcams.com/video/UzJjb10SlA0/video.html
Thank you mamm
You're welcome👍
Did it helped you?
@@CSCORNERSunitaRai yes ma'am🥰🥰
Mam if we use postgresql the same process will be followed for connectivity purpose??
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
Check whether u hv entered correct login details or check console id any ereor
Good mam
You're welcome!👍Please subscribe 😊
maam like servlet we are using in it, don't we need .xml file to map the servlet????
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)
You need to paste jstl.jar and standard. jar files to tomcat lib folder
@@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
This is driver name
in 9:44 , where can i get my my own password?
Thnx
You're welcome!👍Please subscribe 😊
@@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?
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
You’re welcome 😊
Hello Ma'am actually Im facing troble to add mysql connector in server runtime so can i add connector in classpath.
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)
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
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
Did you added connector. jar
my servlet page not working is show a error in resource not avilable in Login project
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.
I'll try
@@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?
Please check action attribute of form tag.
Also make sure your jsp Or html files are under webapp
Mam, now it's working. But showing only login failed page for every input, not displayed welcome.jsp file for correct username and password.
@@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
@@ybsigma3317 I get this error too. Now I fixed it thank you!
@@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
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
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
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.
U can send messages on my telegram
Even after organising imports, the errors are still there
What error u r getting?
After executing the code loginsevlet page showing empty blank page.
Nothing is visible...
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
yes I'll.
If u can share your requirement exactly
@@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
use include action or directive or requestdispatcher include method
mam can we store the inputs like name, mail in jsp page in Mysql database?
Yes yes
@@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
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
Check your database connectivity
hi mam, great tutorial but I was running into an issue, I got Login failed for every input
Is the connection established successfully?
Check your table name and column name. Also check whether you have data in table or not
@@CSCORNERSunitaRai I checked mam, the issue has now been resolved, thankyou.
@@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
Check my tomcat tutorial
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
Did you kept your jsp file in web apps folder
Yess mam
maam the printwriter line is not visible can u please tell what is was 14:30
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.
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..
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
Me to if you found error please share me
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
Join my telegram.. Already shared
Ok