122 Java Registration form with database Mysql, Oracle database students with source code

Published: 18 December 2018
on channel: tech fort
3,864
73

For login registration form java source code, student registration form in java with database connectivity Oracle, MYsql, servlet, sqlyog, html registration form with database connectivity Jsp with Mysql an example for Login and Registration Page JAVA - How To Design Login And Register Form In Java Netbeans servlet registration form example with database

#Example java web application using above three ways to create RequestDispatcher object:Approach 2:(Using ServletContext object)
================================================================
Two ways:
1) Servlet + HTML + Oracle + Tomcat Server
2) Servlet + HTML + Mysql + Tomcat Server +SQLYog(GUI For Mysql)

Deployment Directory Structure:
-------------------------------
38RegistrationWA
----------------
|----------register.html
|----------WEB-INF
|-----web.xml
|-----lib
|----ojdbc14.jar (Oracle)
|----mysql-connector-java-5.1.10-bin.jar
|----------classes
|-------RegistrationServlet.java
|-------SuccessServlet.java
|----------*.class

Step 1) Create table in database (Oracle Or Mysql)
--------------------------------------------------
Create table Students(fname varchar(20),lname varchar(20),email varchar(50),gender varchar(7),subjects varchar(30),Comments varchar(100), city varchar(14));

Step 2) Create Deployment Directory Structure:

Step 3) registration.html

Step 4) RegistrationServlet.java

Step 5) SuccessServlet.java

Step 6) Add ojdbc14.jar Oracle for Oracle Database

Step 7) Compile The Servlet Programs (Do confirm servlet-api.jar in classpth )

Step 8) Deploy the Java web application

(Skip already our Context Root Folder 38RegistrationWA is present in webapps folder of Tomcat)

Copy and paste 38RegistrationWA folder to C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps

Step 9) Start the tomcat server:
C:\Program Files\Apache Software Foundation\Tomcat 9.0\bin\Tomcat9.exe

Step 10) Test the 38RegistrationWA java web applicatoin
Open the browser
http://localhost:2020/38RegistrationWA
OR
http://127.0.0.1:2020/38RegistrationWA
OR
http://YourMachineName:2020/38RegistrationWA


Step 11)Check in Oracle DB table students

Select * from students;


java.sql.SQLException: ORA-12899: value too large for column "SCOTT"."STUDENTS"."COMMENTS" (actual: 123, maxim
um: 50)

and response sent back to again registration.html page with failed message.


Lets Try with HTTP Get Method based Request.

Lets Try With MySql Database (Above Applicaion).
=================================================
To interact with Mysql database im MYSQL GUI interface i.e "SQLYog".

Create table Students(fname varchar(20),lname varchar(20),email varchar(50),gender varchar(7),subjects varchar(30),Comments varchar(100), city varchar(14));

Table successfully created in mysql.

Step 12) Change Connection driver class and URL in RegistrationServlet.java

Step 13) Add the Mysql Connector jar to lib folder mysql-connector-java-5.1.10-bin.jar file to

C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\38RegistrationWA\WEB-INF\lib

Step 14) Compile the Servlet

Step 15) Reload the 38RegistrationWA web application by mvoing to tomacat admin console

Step 16) Test the 38RegistrationWA java web applicatoin
Open the browser
http://localhost:2020/38RegistrationWA
OR
http://127.0.0.1:2020/38RegistrationWA
OR
http://YourMachineName:2020/38RegistrationWA

#java #login #register #form #page #project #source_code #netbeans #mysql #sqlyog #source #code #step #students #beginners #login #registration #form #database