SlideShare a Scribd company logo
1 of 16
Java Database Connectivity
JDBC Connectivity Steps…
By
Prof. Sandeep Vishwakarma
What is JDBC
Java Database Connectivity (JDBC) is an
application programming interface (API) for the
programming language Java, which defines how a
client may access a database. It is a Java-based
data access technology used for Java database
connectivity. It is part of the Java Standard Edition
platform, from Oracle Corporation.
Architecture of JDBC
Steps to Connect..
• First do the Driver Registration
•Define the Connection URL
•Established The Connection
•Create Statement Object
•Execute a Query
•Process the Results
•Close the Connection
Steps to Connect..
• Example to register the OracleDriver class
Class.forName("oracle.jdbc.driver.OracleDriver");
• Example to register the MySqlDriver class
Class.forName("com.mysql.jdbc.Driver");
• Example to register the DerbyClient
Class.forName("org.apache.derby.jdbc.ClientDriver ");
 Define the Driver Registration URL:
Class.forName();
Steps to Connect..
 Established the Connection:-
Connection con=DriverManager.getConnection(
“URL",“username",“password");
• Example to Established the Connection using MySql:-
Connection con=DriverManager.getConnection(
"jdbc:mysql://localhost:3306/sandeep","root","root");
Steps to Connect..
 Create a Statement Object:
Statement stmt=con.createStatement();
Steps to Connect..
 Execute the Query:
 For the SELECT Query:
• String sql="Select * from emp";
• stmt.executeQuery(sql);
 For Insert/Update Query:
• String sql="Insert into emp values(101,'sandeep');
• stmt.executeUpdate(sql);
Steps to Connect..
 Process the Result:-
ResultSet rs=stmt.executeQuery(sql);
while(rs.next())
{
System.out.println(rs.getInt(1)+" "+rs.getString(2));
}
Steps to Connect..
 Close the Connection:
release all the resources that the Connection
is holding.
stmt.close();
con.close();
 Step-1 Driver Registration
Class.forName("com.mysql.jdbc.Driver");
 Step-2 Database Connection
Connectioncon=DriverManager.getConnection
("jdbc:mysql://localhost:3306/cbs","root","root");
//here cbs is the database name, root is the username and root is the password
 Step-3 Creating statement
Statement stmt=con.createStatement();
 Step-4 Creating result statement
ResultSet rs=stmt.executeQuery("select * from emp");
 Step-5 Process the result
while(rs.next())
System.out.println(rs.getInt(1)+"t"+rs.getString(2));
 Step-6 Close the Connection
con.close();
Summarizing the
Connection steps
Thank You
Practical-2(A)
Using Request DispatcherInterface create a Servlet which
will validate the password entered by the user, if the user
has entered "Servlet" as password, then he will be
forwarded to Welcome Servlet else the user will stay on
the index.html page and an error message will be
displayed.
By
Prof. Sandeep Vishwakarma
Demonstration of RequestDispatcher
• index.html will have form fields to get user
information.
• Validate.java will validate the data entered
by the user.
• Welcome.java will be the welcome page.
• web.xml , the deployment descriptor.
Jdbc ppt

More Related Content

What's hot (20)

Enterprise java unit-1_chapter-1
Enterprise java unit-1_chapter-1Enterprise java unit-1_chapter-1
Enterprise java unit-1_chapter-1
 
Java rmi
Java rmiJava rmi
Java rmi
 
JDBC – Java Database Connectivity
JDBC – Java Database ConnectivityJDBC – Java Database Connectivity
JDBC – Java Database Connectivity
 
Hibernate ppt
Hibernate pptHibernate ppt
Hibernate ppt
 
Introduction to EJB
Introduction to EJBIntroduction to EJB
Introduction to EJB
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
Jsp ppt
Jsp pptJsp ppt
Jsp ppt
 
Enterprise java unit-3_chapter-1-jsp
Enterprise  java unit-3_chapter-1-jspEnterprise  java unit-3_chapter-1-jsp
Enterprise java unit-3_chapter-1-jsp
 
Enterprise java unit-2_chapter-1
Enterprise  java unit-2_chapter-1Enterprise  java unit-2_chapter-1
Enterprise java unit-2_chapter-1
 
Jdbc architecture and driver types ppt
Jdbc architecture and driver types pptJdbc architecture and driver types ppt
Jdbc architecture and driver types ppt
 
Java RMI
Java RMIJava RMI
Java RMI
 
Servlet and servlet life cycle
Servlet and servlet life cycleServlet and servlet life cycle
Servlet and servlet life cycle
 
Java database connectivity with MYSQL
Java database connectivity with MYSQLJava database connectivity with MYSQL
Java database connectivity with MYSQL
 
Mvc architecture
Mvc architectureMvc architecture
Mvc architecture
 
Java EE Introduction
Java EE IntroductionJava EE Introduction
Java EE Introduction
 
Java database connectivity
Java database connectivityJava database connectivity
Java database connectivity
 
Jdbc Ppt
Jdbc PptJdbc Ppt
Jdbc Ppt
 
Java Server Pages
Java Server PagesJava Server Pages
Java Server Pages
 
JDBC Architecture and Drivers
JDBC Architecture and DriversJDBC Architecture and Drivers
JDBC Architecture and Drivers
 
Servlets
ServletsServlets
Servlets
 

Similar to Jdbc ppt (20)

JDBC
JDBCJDBC
JDBC
 
Jdbc
JdbcJdbc
Jdbc
 
Jdbc
JdbcJdbc
Jdbc
 
Java JDBC
Java JDBCJava JDBC
Java JDBC
 
Lecture17
Lecture17Lecture17
Lecture17
 
JDBC Connecticity.ppt
JDBC Connecticity.pptJDBC Connecticity.ppt
JDBC Connecticity.ppt
 
Lecture 1. java database connectivity
Lecture 1. java database connectivityLecture 1. java database connectivity
Lecture 1. java database connectivity
 
Jdbc
JdbcJdbc
Jdbc
 
Jdbc day-1
Jdbc day-1Jdbc day-1
Jdbc day-1
 
Data Access with JDBC
Data Access with JDBCData Access with JDBC
Data Access with JDBC
 
Jdbc
Jdbc   Jdbc
Jdbc
 
22jdbc
22jdbc22jdbc
22jdbc
 
Jdbc
JdbcJdbc
Jdbc
 
Jdbc (database in java)
Jdbc (database in java)Jdbc (database in java)
Jdbc (database in java)
 
Jdbc
JdbcJdbc
Jdbc
 
Jdbc
JdbcJdbc
Jdbc
 
JDBC - JPA - Spring Data
JDBC - JPA - Spring DataJDBC - JPA - Spring Data
JDBC - JPA - Spring Data
 
High Performance Jdbc
High Performance JdbcHigh Performance Jdbc
High Performance Jdbc
 
jdbc_presentation.ppt
jdbc_presentation.pptjdbc_presentation.ppt
jdbc_presentation.ppt
 
10 J D B C
10  J D B C10  J D B C
10 J D B C
 

More from sandeep54552

Dijkstra Searching Algorithms Shortest.pptx
Dijkstra Searching Algorithms Shortest.pptxDijkstra Searching Algorithms Shortest.pptx
Dijkstra Searching Algorithms Shortest.pptxsandeep54552
 
E_R-Diagram (2).pptx
E_R-Diagram (2).pptxE_R-Diagram (2).pptx
E_R-Diagram (2).pptxsandeep54552
 
Dijkstra Searching Algorithms.pptx
Dijkstra Searching Algorithms.pptxDijkstra Searching Algorithms.pptx
Dijkstra Searching Algorithms.pptxsandeep54552
 
YCMOU_FYBCA_DS_Unit-7.ppt
YCMOU_FYBCA_DS_Unit-7.pptYCMOU_FYBCA_DS_Unit-7.ppt
YCMOU_FYBCA_DS_Unit-7.pptsandeep54552
 
Queue_Data_Structure.pptx
Queue_Data_Structure.pptxQueue_Data_Structure.pptx
Queue_Data_Structure.pptxsandeep54552
 
Tree_Definition.pptx
Tree_Definition.pptxTree_Definition.pptx
Tree_Definition.pptxsandeep54552
 
Stack_Application_Infix_Prefix.pptx
Stack_Application_Infix_Prefix.pptxStack_Application_Infix_Prefix.pptx
Stack_Application_Infix_Prefix.pptxsandeep54552
 
Stack_Data_Structure.pptx
Stack_Data_Structure.pptxStack_Data_Structure.pptx
Stack_Data_Structure.pptxsandeep54552
 
File handling in c++
File handling in c++File handling in c++
File handling in c++sandeep54552
 
Exception handling in c++
Exception handling in c++Exception handling in c++
Exception handling in c++sandeep54552
 
Inheritance in c++
Inheritance in c++ Inheritance in c++
Inheritance in c++ sandeep54552
 
Constructor and Destructors in C++
Constructor and Destructors in C++Constructor and Destructors in C++
Constructor and Destructors in C++sandeep54552
 
C++ programming introduction
C++ programming introductionC++ programming introduction
C++ programming introductionsandeep54552
 

More from sandeep54552 (20)

Dijkstra Searching Algorithms Shortest.pptx
Dijkstra Searching Algorithms Shortest.pptxDijkstra Searching Algorithms Shortest.pptx
Dijkstra Searching Algorithms Shortest.pptx
 
E_R-Diagram (2).pptx
E_R-Diagram (2).pptxE_R-Diagram (2).pptx
E_R-Diagram (2).pptx
 
Dijkstra Searching Algorithms.pptx
Dijkstra Searching Algorithms.pptxDijkstra Searching Algorithms.pptx
Dijkstra Searching Algorithms.pptx
 
DFS_New.pptx
DFS_New.pptxDFS_New.pptx
DFS_New.pptx
 
Agents_AI.ppt
Agents_AI.pptAgents_AI.ppt
Agents_AI.ppt
 
YCMOU_FYBCA_DS_Unit-7.ppt
YCMOU_FYBCA_DS_Unit-7.pptYCMOU_FYBCA_DS_Unit-7.ppt
YCMOU_FYBCA_DS_Unit-7.ppt
 
Queue_Data_Structure.pptx
Queue_Data_Structure.pptxQueue_Data_Structure.pptx
Queue_Data_Structure.pptx
 
Tree_Definition.pptx
Tree_Definition.pptxTree_Definition.pptx
Tree_Definition.pptx
 
Stack_Application_Infix_Prefix.pptx
Stack_Application_Infix_Prefix.pptxStack_Application_Infix_Prefix.pptx
Stack_Application_Infix_Prefix.pptx
 
Stack_Data_Structure.pptx
Stack_Data_Structure.pptxStack_Data_Structure.pptx
Stack_Data_Structure.pptx
 
Heap_Sort1.pptx
Heap_Sort1.pptxHeap_Sort1.pptx
Heap_Sort1.pptx
 
Quick_sort1.pptx
Quick_sort1.pptxQuick_sort1.pptx
Quick_sort1.pptx
 
Link_List.pptx
Link_List.pptxLink_List.pptx
Link_List.pptx
 
Templates in c++
Templates in c++Templates in c++
Templates in c++
 
File handling in c++
File handling in c++File handling in c++
File handling in c++
 
Exception handling in c++
Exception handling in c++Exception handling in c++
Exception handling in c++
 
Inheritance in c++
Inheritance in c++ Inheritance in c++
Inheritance in c++
 
Constructor and Destructors in C++
Constructor and Destructors in C++Constructor and Destructors in C++
Constructor and Destructors in C++
 
C++ programming introduction
C++ programming introductionC++ programming introduction
C++ programming introduction
 
Jsp tag library
Jsp tag libraryJsp tag library
Jsp tag library
 

Recently uploaded

AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 

Recently uploaded (20)

AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 

Jdbc ppt

  • 1. Java Database Connectivity JDBC Connectivity Steps… By Prof. Sandeep Vishwakarma
  • 2. What is JDBC Java Database Connectivity (JDBC) is an application programming interface (API) for the programming language Java, which defines how a client may access a database. It is a Java-based data access technology used for Java database connectivity. It is part of the Java Standard Edition platform, from Oracle Corporation.
  • 4.
  • 5. Steps to Connect.. • First do the Driver Registration •Define the Connection URL •Established The Connection •Create Statement Object •Execute a Query •Process the Results •Close the Connection
  • 6. Steps to Connect.. • Example to register the OracleDriver class Class.forName("oracle.jdbc.driver.OracleDriver"); • Example to register the MySqlDriver class Class.forName("com.mysql.jdbc.Driver"); • Example to register the DerbyClient Class.forName("org.apache.derby.jdbc.ClientDriver ");  Define the Driver Registration URL: Class.forName();
  • 7. Steps to Connect..  Established the Connection:- Connection con=DriverManager.getConnection( “URL",“username",“password"); • Example to Established the Connection using MySql:- Connection con=DriverManager.getConnection( "jdbc:mysql://localhost:3306/sandeep","root","root");
  • 8. Steps to Connect..  Create a Statement Object: Statement stmt=con.createStatement();
  • 9. Steps to Connect..  Execute the Query:  For the SELECT Query: • String sql="Select * from emp"; • stmt.executeQuery(sql);  For Insert/Update Query: • String sql="Insert into emp values(101,'sandeep'); • stmt.executeUpdate(sql);
  • 10. Steps to Connect..  Process the Result:- ResultSet rs=stmt.executeQuery(sql); while(rs.next()) { System.out.println(rs.getInt(1)+" "+rs.getString(2)); }
  • 11. Steps to Connect..  Close the Connection: release all the resources that the Connection is holding. stmt.close(); con.close();
  • 12.  Step-1 Driver Registration Class.forName("com.mysql.jdbc.Driver");  Step-2 Database Connection Connectioncon=DriverManager.getConnection ("jdbc:mysql://localhost:3306/cbs","root","root"); //here cbs is the database name, root is the username and root is the password  Step-3 Creating statement Statement stmt=con.createStatement();  Step-4 Creating result statement ResultSet rs=stmt.executeQuery("select * from emp");  Step-5 Process the result while(rs.next()) System.out.println(rs.getInt(1)+"t"+rs.getString(2));  Step-6 Close the Connection con.close(); Summarizing the Connection steps
  • 14. Practical-2(A) Using Request DispatcherInterface create a Servlet which will validate the password entered by the user, if the user has entered "Servlet" as password, then he will be forwarded to Welcome Servlet else the user will stay on the index.html page and an error message will be displayed. By Prof. Sandeep Vishwakarma
  • 15. Demonstration of RequestDispatcher • index.html will have form fields to get user information. • Validate.java will validate the data entered by the user. • Welcome.java will be the welcome page. • web.xml , the deployment descriptor.