Posts

Showing posts from May, 2023

Practical-18 Develop a JSP program to display the grade of a student by accepting the marks of five subjects.

Image
index.html: <!DOCTYPE html> <html>     <head>         <title>Enter Marks</title>         <meta charset="UTF-8">         <meta name="viewport" content="width=device-width, initial-scale=1.0">     </head>     <body>         <p>Enter Marks</p>         <form action="result.jsp" method="get">             Enter AJP Marks : <input type="text" name="ajp"> <br><br>             Enter NMA Marks : <input type="text"  name="nma"><br><br>             Enter MCAD Marks : <input type="text"  name="mcad"><br><br>             Enter PPUD Marks : <input type="text"  name="ppud"><br><br>             Enter Project Marks : <input type="text"  name="proj"><br><br>             <input type="submit&

Practical-17 Develop a simple JSP program for user login form with static and dynamic database.

Image
User login form with Static Database: index.html: <!DOCTYPE html> <html>     <head>         <title>With Static Database</title>         <meta charset="UTF-8">         <meta name="viewport" content="width=device-width, initial-scale=1.0">     </head>     <body>        <form action="static-action.jsp" method="post">             Username: <input type="text" name="name"/><br/>             Password: <input type="password" name="pass"/> <br/>             <button type="submit">Login</button>         </form>     </body> </html> static-action.jsp: <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html> <html>     <head>         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">      

Practical-16 Develop a simple JSP program for user registration and then control will be transfer it into second page.

Image
index.html: <!DOCTYPE html> <html>     <head>         <title>JSP Program</title>         <meta charset="UTF-8">         <meta name="viewport" content="width=device-width, initial-scale=1.0">     </head>     <body>         <form action="second.jsp" method="post">             Enter your UserName: <input type="text" name="name"><br>             Enter your Password: <input type="password" name="pass"><br>             Enter your email: <input type="email" name="email"><br>             <input type="submit" value="Submit">         </form>     </body> </html> second.jsp: <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html> <html>     <head>         <meta http-equiv="Content-Type&

Practical-15 Create a web form which processes servlet and demonstrates use of cookies and sessions.

Use of Cookies in Servlet: index.html: <!DOCTYPE html> <html>     <head>         <title>Use of Cookie</title>         <meta charset="UTF-8">         <meta name="viewport" content="width=device-width, initial-scale=1.0">     </head>     <body>          <form id="CookiDemo" action="AddCookieServlet" method="POST">             <b>Enter a value for MyCookie:</b>             <input type="text" name="data" size=25 value=""/>             <br><br>             <input type="submit" name="Submit"/>         </form>     </body> </html> Create Two Servlet File with name AddCookieServlet and GetCookieServlet 1. AddCookieServlet.java: import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class AddCookieServlet extends HttpServlet {     protected void doPost(

Practical-14 Develop a simple servlet program which maintains a counter for the number of times it has been accessed since its loading, initialize the counter using deployment descriptor.

Image
 index.html: <!DOCTYPE html> <html>     <head>         <title>Practical-14</title>         <meta charset="UTF-8">         <meta name="viewport" content="width=device-width, initial-scale=1.0">     </head>     <body>         <form action="HitCounter" method="GET">             <input type="submit" value="OK">         </form>     </body> </html> HitCounter.java: import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class HitCounter extends HttpServlet {              int c;     public void init(ServletConfig s) throws ServletException     {         c=Integer.parseInt(s.getInitParameter("HitCounter"));     }     public ServletConfig getServletConfig()     {      return null;     }     protected void doGet(HttpServletRequest request, HttpServletResponse response)         throws ServletException, IOExcepti

Practical-13 Develop a program to present a set of choice for user to select a product and display the price of product.

Image
Give Project Name as practical13 1. First Make a DataBase Name is Student. 2.  Make a Table Name is product.       Create table product(id int(10),     p_name varchar(30),     p_price int(10) ); 3. Insert Data.       insert into product values(01,'Laptop',35000);      insert into product values(02,'Desktop',30000);      insert into product values(03,'Keyboard',700);      insert into product values(04,'Mouse',500); 4. File Name       GUIList.java : This file include all GUI of Frame. DataDB.java:  Create  Connection & Pass Query & get Data From Database. DriverClass.java : This Class file define all basic parameter of Database Connectivity. Code: GUIList.java: import java.awt.*; import java.awt.event.*; import java.sql.*; import java.util.*; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.*; public class GUIList extends JFrame implements ItemListener {     JComboBox combo;     JPanel p,p2;     JLabel Id,IdValue,

Practical-12 Develop a Graphical User Interface that performs the following SQL operations: a) Insert b) Delete c)Update

Image
Project Name should be practical12 1) First Make a DataBase Name is Student. 2) Make a Table Name is st. Create table st(firstName varchar(30), lastName varchar(30), erNumber int, age int, gen varchar(30)); 3)FileName: 1. Main Class:Pra_12_java.java 2. insert & Update GUI: Form.java 3. DataBase Connection:DriverClass.java 4. Insert & Update: DriverDB 5. BackButton: Back_Button.java Code: Pra_12_java.java: import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.sql.SQLException; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.*; public class Pra_12_java extends JFrame implements ActionListener {     DriverDB db=new DriverDB();     CardLayout card;     JButton insert, delete, update,sumbitDel,submitUp;     JPanel p_insert, p_delete, p_update, p1,p_update_in;     JLabel for_delete,for_update,er_update_label,Result;     JTextField delete_no,er_update_no;          public static boolean flag=false;