Synopsis ON Sementic Web: Swami Devi Dyal Institute of Engineering and Technology
Synopsis ON Sementic Web: Swami Devi Dyal Institute of Engineering and Technology
SYNOPSIS
ON
SEMENTIC WEB
Submitted by:-
Ankur Goyal(2208608)
IT 5th sem
INDEX
1. INTRODUCTION
1.1 JAVA SERVLET
1.2 RMI
1.3 JDBC-ODBC
1.4 DATAGRAM
2. SYSTEM REQUIREMENTS
3.2 PLATFORM
3.2.1 Software Requirements
3.2.2 Hardware Requirements
3. IMPLEMENTATION
5.1 FORMS
5.2 COADING
Front.java
import java.io.*;
import javax.servlet.*;
import java.sql.*;
pw.print("</table>");
pw.print("<table border=2 bgcolor= white align=right cellpadding=2
cellspacing=2 >");
pw.print("<th> " + " <font size=6 color=#347C17><b> " +
"Electronics goods " + "</font> " + " </th>");
pw.print("<tr> " + "<td> " + " <a
href='http://localhost:8080/servlet/ece'> " + "<img
src='D:\\onlineshopping\\tv1.jpg'> " + "</a> ");
pw.print(" ");
pw.print("<a href='d:\\onlineshopping\\mobile.html'> " + "<img
src='D:\\onlineshopping\\mb2.jpg'></a>");
pw.print(" ");
pw.print("<a href='http://localhost:8080/servlet/ece'> " + "<img
src='D:\\onlineshopping\\dvd2.jpg'> " + " </a> ");
pw.print(" ");
pw.print("<a href='http://localhost:8080/servlet/ece'> " + "<img
src='D:\\onlineshopping\\lp1.jpg'> " + "</a> " + "</td> " + "</tr>");
pw.print("<th> " + "<font size=6 color=#347C17><b> " + "Art &
Games</b> " + "</font>");
pw.print("<tr> " + "<td> " + "<a
href='http://localhost:8080/servlet/art'> " + "<img
src='D:\\onlineshopping\\art1.jpg'> " + "</a>");
pw.print("<a href='http://localhost:8080/servlet/game'> " + "<img
src='D:\\onlineshopping\\gm1.jpg'> " + "</a>");
pw.print("<a href='http://localhost:8080/servlet/art'> " + "<img
src='D:\\onlineshopping\\art2.jpg'> " + "</a>");
pw.print("<a href='http://localhost:8080/servlet/game'> " + "<img
src='D:\\onlineshopping\\gm2.jpg'> " + "</a> " + "</td> " + "</tr> "
+ "</table>");
pw.print("<img src='d:\\onlineshopping\\cata.jpg' align=left> " +
"<br><br><br>");
pw.print(" <table border=0 bgcolor= #56A5EC align=left
width=190>");
pw.print("<tr>");
pw.print("<td> " + "<b><a href='http://localhost:8080/servlet/ece'> "
+ "<img src='D:\\onlineshopping\\arw.jpg' align=left hight=20
width=20> " + "<font color=white size=4 > " + "Electronics & " + "
Computer " + "</a> " + "</td> " + "</tr>");
pw.print("<tr>");
pw.print("<td> " + "<b><a href='http://localhost:8080/servlet/art '> "
+ "<img src='D:\\onlineshopping\\arw.jpg' align=left hight=20
width=20> " + "<font color=white size=4> " + "Art & Paintings " +
"</a> " + "</td>");
pw.print("</tr>");
pw.print("<tr>");
pw.print("</body>");
pw.print("</html>");
}
}
Registration1.java
import java.io.*;
import javax.servlet.*;
import java.sql.*;
pw.print("
");
pw.print("<font size=10 color=#347C17 ><b> " + " <i>ONLINE
SHOPPING</i></b> " + " </font>");
pw.print("<hr width=100% color=orange size=2 >");
pw.print("<font color=#15317E><b> " + " <a
href='http://localhost:8080/servlet/registration1'> " + " New
user</a> " + " " + " <font color=#15317E> " + " <a
href='http://localhost:8080/servlet/regis'><b> " + " Registered
user</a> " + " " + " <font color=#15317E> " + " <a
href='http://localhost:8080/servlet/accountinfo'><b> " + "
MyAccount</a>");
pw.print("<hr width=100% color=#3BB9FF size=10 >");
pw.print("<marquee > " + " <font color=orange size=3><b> " + "
Register To Yourself " + " </font> " + " </marquee> " + "
<br><br><br><br>");
pw.print("</table>");
pw.print("<img src='d:\\onlineshopping\\cata.jpg' align=left>" + " <p
align=center><font color=blue size=4>" + " Providing accurate
contact details are important to have smooth transaction" + "</font>
</p>");
pw.print(" <table border=0 bgcolor= #56A5EC align=left
idth=190>");
pw.print("<tr>");
pw.print("<td> " + "<b><a href='http://localhost:8080/servlet/ece'> "
+ "<img src='D:\\onlineshopping\\arw.jpg' align=left hight=20
width=20> " + "<font color=white size=4 > " + "Electronics & " + "
Computer " + "</a> " + "</td> " + "</tr>");
pw.print("<tr>");
pw.print("<td> " + "<b><a href='http://localhost:8080/servlet/art '> "
+ "<img src='D:\\onlineshopping\\arw.jpg' align=left hight=20
width=20> " + "<font color=white size=4> " + "Art & Paintings " +
"</a> " + "</td>");
pw.print("</tr>");
pw.print("<tr>");
import java.io.*;
import javax.servlet.*;
import java.sql.*;
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:onlineshoping");
Statement stat1,stat2,stat3,stat4;
stat1=con.createStatement();
stat2=con.createStatement();
stat3=con.createStatement();
stat4=con.createStatement();
stat1.executeUpdate("delete from usertemp");
stat2.executeUpdate("delete from banktemp");
stat3.executeUpdate("delete from totaltemp");
stat4.executeUpdate("delete from itemtemp");
while(rest.next())
{
i++;
}}
catch(Exception e)
{
pw.print(e);
}
String ss;
if(i>0)
{
ss=req.getParameter("t1");
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:onlineshoping");
String f=rest.getString(1);
PreparedStatement pstat2=con.prepareStatement("insert into
usertemp values(?,?)");
pstat2.setString(1,ss);
pstat2.setString(2,f);
pstat2.executeUpdate();
pw.print("<html>");
pw.print("<body>");pw.print("<p align=right> " + "
<http://localhost:8080/servlet/front>" + "<font color=#15317E><b> "
+ " HOME</a> " + " ");
pw.print("<a href=> " + " <font color=#15317E><b> " + " ABOUT
US</a> " + " " + " <a href=> " + " <font
color=#15317E><b> " + " FEEDBACK</a> " + " </p> " + " <img
src='d:\\onlineshopping\\india.jpg'> ");
pw.print("<pre>" + " <font
color=blue size=4>" + "<b>");pw.print("Welcome</b> " + f);
pw.print(" </font> " + " </pre>");
pw.print(" <hr width=100% color=#3BB9FF size=4>");
pw.print("<img src='D:\\onlineshopping\\sidelogo.jpg' align=left> " +
" <img src='D:\\onlineshopping\\sidelogo.jpg' align=right>" + "
<br><br>");
pw.print("
");
pw.print("<font size=10 color=#347C17 ><b> " + " <i>ONLINE
SHOPPING</i></b> " + " </font>");
pw.print("<hr width=100% color=orange size=2 >");
pw.print("<font color=#15317E><b> " + " <a
href='http://localhost:8080/servlet/registration1'> " + " New user</a>
" + " " + " <font color=#15317E> " + " <a
href='http://localhost:8080/servlet/regis'><b> " + " Registered
user</a> " + " " + " <font color=#15317E> " + " <a
href='http://localhost:8080/servlet/accountinfo'><b> " + "
MyAccount</a>");
pw.print("
&
nbsp; &nb
sp;
&
nbsp; &nb
sp; ");
pw.print("
&
nbsp; &nb
sp;
&
nbsp; &nb
sp; " + " <font color=#15317E><b> " + " <a
href='http://localhost:8080/servlet/logout'> " + " logout</a>");
pw.print("<hr width=100% color=#3BB9FF size=10 >");
pw.print("<marquee > " + " <font color=orange size=3><b> " + "
Welcome to Online Shopping " + " </font> " + " </marquee> " + "
<br>")pw.print("</table>");
pw.print("<table border=2 bgcolor= white align=right cellpadding=2
cellspacing=2 >");
pw.print("<th> " + " <font size=6 color=#347C17><b> " +
"Electronics goods " + "</font> " + " </th>");
pw.print("<tr> " + "<td> " + " <a
href='d:\\onlineshopping\\ece.html'> " + "<img
src='D:\\onlineshopping\\tv1.jpg'> " + "</a> ");
pw.print(" ");
pw.print("<a href='d:\\onlineshopping\\mobile.html'> " + "<img
src='D:\\onlineshopping\\mb2.jpg'></a>");
pw.print(" ");
pw.print("<a href='d:\\onlineshopping\\dvd.html'> " + "<img
src='D:\\onlineshopping\\dvd2.jpg'> " + " </a> ");
pw.print(" ");
pw.print("<a href='d:\\onlineshopping\\ece.html'> " + "<img
src='D:\\onlineshopping\\lp1.jpg'> " + "</a> " + "</td> " + "</tr>");
pw.print("<th> " + "<font size=6 color=#347C17><b> " + "Art &
Games</b> " + "</font>");
pw.print("<tr> " + "<td> " + "<a href='d:\\onlineshopping\\art.html'>
" + "<img src='D:\\onlineshopping\\art1.jpg'> " + "</a>");
pw.print("<a href='d:\\onlineshopping\\games.html'> " + "<img
src='D:\\onlineshopping\\gm1.jpg'> " + "</a>");
pw.print("<a href='d:\\onlineshopping\\art.html'> " + "<img
src='D:\\onlineshopping\\art2.jpg'> " + "</a>");
pw.print("<a href='d:\\onlineshopping\\games.html'> " + "<img
src='D:\\onlineshopping\\gm2.jpg'> " + "</a> " + "</td> " + "</tr> "
+ "</table>");
pw.print("<img src='d:\\onlineshopping\\cata.jpg' align=left> " +
"<br><br><br>");
pw.print(" <table border=0 bgcolor= #56A5EC align=left
width=190>");pw.print("<tr>");
catch(Exception e1)
{
System.out.println(e1);
}}
else
{
pw.print("userID and Password does not match");
}
}
}
Changepass.java
import java.io.*;
import javax.servlet.*;
import java.sql.*;
Newpass.java
import java.io.*;
import javax.servlet.*;
import java.sql.*;
pstat.setString(1,req.getParameter("t1"));
pstat.setString(2,req.getParameter("t2"));
ResultSet rest =pstat.executeQuery();
while(rest.next())
{
i++;
}
if(i>0)
{
pstat.executeUpdate();
pw.print("<html>");
pw.print("<body>");
pw.print("<form action='http://localhost:8080/servlet/login2'> ");
pw.print("<p align=right> " + " <a
href='d:\\onlineshopping\\front.html'>" + "<font color=#15317E><b>
HOME</a> " + "  " + "<a href=> " + " <font
color=#15317E><b> " + " ABOUT US</a> " + "   " + "
<a href=" + " <font color=#15317E><b> " + " FEEDBACK</a> " + "
</p> ");
pw.print("<img src='d:\\onlineshopping\\india.jpg'> ");
pw.print(" <hr width=100% color=#3BB9FF size=4>" + "<br>");
pw.print("<marquee bgcolor=#347C17> " + "<font color=white
size=4><b>Welcome to online Shopping</font> " +
"</marquee><br><br>");
pw.print("<img src='d:\\onlineshopping\\cata.jpg' align=left> " +
"<br> " + "<br>");
pw.print(" <table border=0 bgcolor= #56A5EC align=left
width=190>");
pw.print("<tr>");
pw.print("<td> " + "<b><a href='http://localhost:8080/servlet/ece'> "
+ "<img src='D:\\onlineshopping\\arw.jpg' align=left hight=20
width=20> " + " <font color=white size=4 >Electronics & " + "
" + "Computer</a></td> " );
pw.print("</tr> ");
pw.print("<td><b> " + "<a
href='http://localhost:8080/servlet/art'><img
src='D:\\onlineshopping\\arw.jpg' align=left hight=20 width=20> " + "
<font color=white size=4>Art & Paintings</a> " + " </td>");
pw.print("</tr>");
pw.print("<tr>");
pw.print("<td><b> " + "<a href='http://localhost:8080/servlet/book'>
" + "<img src='D:\\onlineshopping\\arw.jpg' align=left hight=20
width=20> " + " <font color=white size=4>Books & Magazines</a> " +
"</td>");
pw.print("</tr>");
pw.print("<tr>");
pw.print("<td><b> " + "<a
href='http://localhost:8080/servlet/moblie'> " + "<img
src='D:\\onlineshopping\\arw.jpg' align=left hight=20 width=20> " + "
<font color=white size=4>Mobile & Cameras<b></a> " + " </td>");
pw.print("</tr>");
pw.print("<tr>");
pw.print("<td><b> " + " <a href='http://localhost:8080/servlet/game'>
" + " <font color=white size=4 > " + "<img
src='D:\\onlineshopping\\arw.jpg' align=left hight=20
width=20>Games<b></a> " + " </td>");
pw.print("</tr>");
pw.print("</table>");
pw.print("<table border=0 align=center>");
pw.print("<tr> " + " <td><b>userID</b> " + "
" + " <input
type=password name=t1> " + " </td> " + " </tr>");
pw.print("<tr> " + " <td><b>Password</b> " +
" <input type=password name=t2> " + " </td> " + "</tr> " + "<tr> "
+ " <td>");
pw.print("
");
pw.print("<font color=red> " + " Forget Your Password ? " + "
</font> " + " </tr> " + " <td>");
pw.print("<tr> " + " <td>");
pw.print("
");
pw.print("<font color=red> " + " <a
href='http://localhost:8080/servlet/changepass'> " + "Change
Password ? " + " </a> " + " </font> " + " </tr> " + " <td>");
pw.print("</table>");
pw.print("<pre>" + " <input type=submit
name=b1 value=Signin style='color:white;background:#347C17'>");
pw.print("</form>");
pw.print("</body>");
pw.print("</html>");
}
else
{
pw.print("Old Password and ID does not match.");
}
}
catch(Exception e1)
{
}
}
}
Accountinfo.java
import java.io.*;
import javax.servlet.*;
import java.sql.*;
import java.util.Date;
import java.text.*;
public class accountinfo extends GenericServlet
res.setContentType("text/html");
PrintWriter pw=res.getWriter();
pw.print("<html>");
pw.print("<body>");
pw.print("<form action=" + "http://localhost:8080/servlet/myaccount"
+ ">");
pw.print(" <html> ");
pw.print(" <body> ");
pw.print("<form action=" + "http://localhost:8080/servlet/last" +
">");
pw.print(" <p align=right>" + " <a
href='http://localhost:8080/servlet/front'> " + "<font color=#15317E>"
+ "<b> " + "HOME " + " </a> " + " "
+ "<a href='http://localhost:8080/servlet/aboutus'> " + "<font
color=#15317E>" + "<b> " + " ABOUT US " + " </a> " +
"  " + "</font>" + "<font color=#15317E>" + "<b> " +
"FEEDBACK" + "</p> ");
pw.print(" <img src='d:\\onlineshopping\\india.jpg'> ");
pw.print(" <hr width=100% color=#3BB9FF size=4> ");
pw.print(" <br> ");
pw.print(" <img src='d:\\onlineshopping\\cata.jpg' align=left> ");
pw.print(" <center> " + "<font color=orange>" + "<b>"+ " Fill these
information if you want to view your account" + "</b>" + "</font>" +
"</center> ");
pw.print(" <br> ");
pw.print(" <table border=0 bgcolor= #56A5EC align=left width=190>
");
pw.print(" <tr> ");
pw.print(" <td><b> " + "<a href='http://localhost:8080/servlet/ece'> "
+ "<img src='D:\\onlineshopping\\arw.jpg' align=left hight=20
width=20><font color=white size=4 >Electronics &
"+" Computer</td> ");
pw.print(" </tr> ");
pw.print(" <tr> ");
pw.print(" <td><b> " + "<a href='http://localhost:8080/servlet/art'> "
+ "<img src='D:\\onlineshopping\\arw.jpg' align=left hight=20
width=20><font color=white size=4>Art & Paintings</td> ");
pw.print(" </tr> ");
pw.print(" <tr> ");
pw.print(" <td><b> " + "<a href='http://localhost:8080/servlet/book'>
" + "<img src='D:\\onlineshopping\\arw.jpg' align=left hight=20
width=20><font color=white size=4>Books & Magazines</a></td> ");
pw.print(" </tr> ");
pw.print(" <tr> ");
pw.print(" <td><b> " + "<a
href='http://localhost:8080/servlet/moblie'> " + "<img
src='D:\\onlineshopping\\arw.jpg' align=left hight=20 width=20><font
color=white size=4>Mobile & Cameras<b></a></td> ");
pw.print(" </tr> ");
pw.print(" <td> " + "<a href='http://localhost:8080/servlet/game'> " +
"<img src='D:\\onlineshopping\\arw.jpg' align=left hight=20
width=20><font color=white size=4>Games<b></a></td> ");
pw.print(" </tr> ");
pw.print("</table> ");
pw.print("<center>");
pw.print(" <b> " + "<font color=blue> " +
"  " + "LoginID </font> " + "<input
type=text name=t1> ");
pw.print("<br>");
pw.print(" <b> " + "<font color=blue> " + " " +
"Password </font>" + "<input type=password name=t2> ");
pw.print("<br>");
pw.print("<br>");
pw.print(" <input type=submit value=view
style=color:white;background:blue name=b1> ");
pw.print("</center>");
pw.print("</body>");
pw.print("</html>");
}
}
Myaccount.java
import java.io.*;
import javax.servlet.*;
import java.sql.*;
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:onlineshoping");
PreparedStatement pstat=con.prepareStatement("select * from
newuser where userID=? and Password=?");
pstat.setString(1,req.getParameter("t1"));
pstat.setString(2,req.getParameter("t2"));
ResultSet rest =pstat.executeQuery();
while(rest.next())
{
i++;
}
if(i>0)
{
String s=req.getParameter("t1");
pstat=con.prepareStatement("select Orderno , Date, ItemName ,
Quantity from purchase where userID=? ");
pstat.setString(1,s);
ResultSet rst1=pstat.executeQuery();
pw.print("<html>");
pw.print("<body>");
pw.print("<p align=right> " + " <a
href=http://localhost:8080/servlet/front>" + "<font
color=#15317E><b> " + " HOME</a> " + " ");
pw.print("<a href='http://localhost:8080/servlet/aboutus'> " + " <font
color=#15317E><b> " + " ABOUT US</a> " + " " + "
<a href=> " + " <font color=#15317E><b> " + " FEEDBACK</a> " +
" </p> " + " <img src='d:\\onlineshopping\\india.jpg'> ");
pw.print(" <hr width=100% color=#3BB9FF size=4>");
pw.print("<img src='D:\\onlineshopping\\sidelogo.jpg' align=left> " +
" <img src='D:\\onlineshopping\\sidelogo.jpg' align=right>" + "
<br><br>");
pw.print("
");
pw.print("<font size=10 color=#347C17 ><b> " + " <i>ONLINE
SHOPPING</i></b> " + " </font>");
pw.print("<hr width=100% color=orange size=2 >");
pw.print("<font color=#15317E><b> " + " <a
href='http://localhost:8080/servlet/registration1'> " + " New
user</a> " + " " + " <font color=#15317E> " + " <a
href='http://localhost:8080/servlet/regis'><b> "
+ " Registered user</a> " + " " + " <font
color=#15317E> " + " <a
href='http://localhost:8080/servlet/accountinfo'><b> " + "
MyAccount</a>");
pw.print("
&nb
sp;
&
nbsp; &nb
sp; ");
pw.print("
&nb
sp;
&
nbsp; &nb
sp; " + " <font
color=#15317E><b> " + " <a
href='http://localhost:8080/servlet/logout'> " + " logout</a>");
pw.print("<hr width=100% color=#3BB9FF size=10 >");
pw.print("<marquee > " + " <font color=orange size=3><b> " + "
Welcome to Online Shopping " + " </font> " + "
</marquee> " + " <br>");
pw.print("</table>");
pw.print("<img src='d:\\onlineshopping\\cata.jpg' align=left> " );
pw.print("<font color=orange size=4> " + "Your Account information
is- " + "</font>");
pw.print("<br><br>");
pw.print(" <table border=0 bgcolor= #56A5EC align=left width=190
align=left>");
pw.print("<tr>");
pw.print("<td> " + "<b><a href='http://localhost:8080/servlet/ece'> "
+ "<img src='D:\\onlineshopping\\arw.jpg' align=left hight=20
width=20> " + "<font color=white size=4 > " + "Electronics & " + "
Computer " + "</a> " + "</td> " + "</tr>");
pw.print("<tr>");
pw.print("<td> " + "<b><a href='http://localhost:8080/servlet/art '> "
+ "<img src='D:\\onlineshopping\\arw.jpg'
while(rst1.next())
pw.print("<tr>");
pw.print("<td>");
pw.print("</table>") ;
else
{
import java.io.*;
import javax.servlet.*;
import java.sql.*;
public class ece extends GenericServlet
{
public void service(ServletRequest req,ServletResponse res)throws
IOException ,ServletException
{
res.setContentType("text/html");
PrintWriter pw=res.getWriter();
pw.print("<html>");
pw.print("<body><p align=right> " + "<a
href='http://localhost:8080//servlet//front'> " + "<font
color=#15317E><b> " + "HOME</a> " + " ");
pw.print("<a href='http://localhost:8080/servlet/aboutus'> " + "<font
color=#15317E><b>" + "ABOUT US " + "</a> " + " "
+ "<a href='http://localhost:8080//servlet//feedback'> " + "<font
color=#15317E><b>" + "FEEDBACK</a> " + "</p>");
pw.print( "<img src='d:\\onlineshopping\\india.jpg'>");
pw.print("<hr width=100% color=#3BB9FF size=4>");
pw.print("<marquee bgcolor=#4E4848> " + " <font color=white font
size=4> " + "Electronics & Computer</font> " + "</marquee>");
pw.print("<br> " + " <br>");
pw.print("<img src='d:\\onlineshopping\\up.gif' align=right> " +
"<br> " + "<br>");
pw.print("<img src='d:\\onlineshopping\\cata.jpg' align=left> " +
"<br> " + "<br>");
pw.print(" <table border=0 bgcolor= #56A5EC align=left
width=190>");
pw.print("<tr>");
pw.print("</th>");
pw.print("</tr>");
pw.print("<tr>");
pw.print("<td> " + "<img src='d:\\onlineshopping\\tv.jpg' align=left>
" + "<br> " + "<a href='http://localhost:8080/servlet/tv2'> " + "<pre>
" );
pw.print("Philips Flat Screen Colour " + " <br> " + "TVs Videocon /
" + " <br> " + " Sansui Colour TVs " + "</a> " + "</td> " + "</tr>");
pw.print("<tr>");
pw.print("<th> " + "<img src='d:\\onlineshopping\\musicp1.jpg'
align=left> " + "<font color=dark orange> " + "MUSIC players<br> "
+ "</font> " + "<pre> " + "<a
href='http://localhost:8080/servlet/mp1'> ");
pw.print("TouchScreen iPod " + "<br> " + " Altec Lancing");
pw.print("iPod Accessories " + " </a>");
pw.print("</th>");
pw.print("</tr>");
pw.print("<tr>");
pw.print("<td> " + "<img src='d:\\onlineshopping\\musicp2.jpg'
align=left> " + "<br> " + "<pre> " + "<a
href='http://localhost:8080/servlet/mp2'>");
pw.print("Sony Walkman Series " + "<br> " + " Music Players " +
"<br> " + " Portable " + "<br> " + " Media Players " + "</a> " +
"</td> " + "</tr>");
pw.print("</table>");
pw.print("<table border=1 bgcolor= #C6DEFF align=right>");
pw.print("<tr>");
pw.print("<th> " + "<img src='d:\\onlineshopping\\dvd1.jpg'
align=left> " + "<font color=dark orange> " + "<a
href='http://localhost:8080/servlet/dv1'>DVD players<br> " + "
</font> ");
pw.print("<pre> " + "Philips Home DVD " + "<br> " + " Players
Videocon Home " + "<br> " + " DVD Players " + "</a> ");
pw.print("</th>");
pw.print("</tr>");
pw.print("<tr>");
pw.print("<td> " + "<img src='d:\\onlineshopping\\dvd2.jpg'
align=left> " + "<br> " + "<pre> " + "<a
href='http://localhost:8080/servlet/dv2'> ");
pw.print(" Philips Portable DVD " + "<br> " + " Players Coby 7 " +
"<br> " + " Portable DVD Player " + " </a>");
pw.print("</td> " + "</tr>");
pw.print("<tr>");
pw.print("<th> " + "<img src='d:\\onlineshopping\\car1.jpg'
align=left> "+ "<font color=dark orange>");
pw.print("In Car Entertainment<br> " + "</font> " + "<pre> " + "<a
href='http://localhost:8080/servlet/car1'>");
pw.print( " Sony Car Stereos " + "<br> " + " @ Rs2999 Car Speakers
" + "<br> " + " & Woofers@Rs1240 " + "</a>");
pw.print("</th>");
pw.print("</tr>");
pw.print("<tr>");
pw.print("<td> " + "<img src='d:\\pp1\\car2.jpg' align=left><br> " +
"<pre> " + "<a href='http://localhost:8080/servlet/car2'> ");
pw.print("Car Displays Starting@ " + "<br> " + " Rs3199 Car GPS "
+ "<br> " + " Navigators " + "</a> " + "</td> " + "</tr> " +
"</table>");
pw.print("<br><br><br><br><br><br><br><br><br><br><br><br>
");
pw.print("</body>");
pw.print("</html>");
}
}
Tv21.java
import java.io.*;
import javax.servlet.*;
import java.sql.*;
pw.print("<html>");
pw.print("<body>");
pw.print("<form action='http://localhost:8080/servlet/pay'
name=f1>");
pw.print("<b> " + "<img src='d:\\onlineshopping\\phl11.jpg'
align=left> " + "<br><br><br> " );
pw.print("<pre> " + " <font color=red size=5> " + "Offer rice
:Rs. 11790</font> " + "<br> " + "<br>");
pw.print(" MRP : Rs. 12990 " + "<br>");
pw.print(" You Save : Rs. 1200(9%) " + "<br>");
pw.print(" EMI Available : Rs.1,965 for 6 months " +
"<br>");
pw.print(" Warranty : Not Applicable " + "<br>");
pw.print(" Return Policy :Applicable ( 10 days Return Policy)
" + "<br>");
pw.print(" Shipping Time : Ships in 10 working days " +
"<br>");
pw.print(" Shipping Charges : 0.00 " + "<br>");
import java.io.*;
import javax.servlet.*;
import java.sql.*;
public class art extends GenericServlet
{
public void service(ServletRequest req,ServletResponse res)throws
IOException ,ServletException
{
res.setContentType("text/html");
PrintWriter pw=res.getWriter();
pw.print("<html>");
pw.print("<body><p align=right> " + "<a
href='http://localhost:8080/servlet/front'> " + "<font
color=#15317E><b> " + "HOME</a> " + " ");
pw.print("<a href='http://localhost:8080/servlet/aboutus'> " + "<font
color=#15317E><b>" + "ABOUT US</a> " + " " + "<a
href='http://localhost:8080/servlet/feedback'> " + "<font
color=#15317E><b>" + "FEEDBACK</a> " + "</p>");
pw.print( "<img src='d:\\onlineshopping\\india.jpg'>");
pw.print("<hr width=100% color=#3BB9FF size=4>");
pw.print("<marquee bgcolor=#4E4848> " + " <font color=white font
size=4> " + "Electronics & Computer</font> " + "</marquee>");
pw.print("<br> " + " <br>");
pw.print("<img src='d:\\onlineshopping\\up.gif' align=right> " +
"<br> " + "<br>");
pw.print("<img src='d:\\onlineshopping\\cata.jpg' align=left> " +
"<br> " + "<br>");
pw.print(" <table border=0 bgcolor= #56A5EC align=left
width=190>");
pw.print("<tr>");pw.print("<td><b> " + "<a
href='http://localhost:8080/servlet/ece'> " + "<img
src='D:\\onlineshopping\\arw.jpg' align=left hight=20 width=20> " +
"<font color=white size=4 > " + "Electronics & " +
" " + "Computer</a> " + "</td> " + "</tr>");
pw.print("<tr>");
pw.print("<td><b> " + "<a href='http://localhost:8080/servlet/art'> "
+ "<img src='D:\\onlineshopping\\arw.jpg' align=left hight=20
width=20> " + "<font color=white size=4> " + "Art & Paintings " +
"</a> " + "</td>");
pw.print("</tr>");
pw.print("<tr>");
pw.print("<td><b> " + "<a href='http://localhost:8080/servlet/book'>
" + "<img src='D:\\onlineshopping\\arw.jpg' align=left hight=20
width=20> " + "<font color=white size=4> " + "Books & Magazines "
+ "</a> " + "</td>");
pw.print("</tr>");
pw.print("<tr>");
pw.print("<td><b> " + "<a
href='http://localhost:8080/servlet/mobile'> " + "<img
src='D:\\onlineshopping\\arw.jpg' align=left hight=20 width=20> " +
"<font color=white size=4> " + "Mobile & Cameras<b> " + "</a> " +
"</td>");
pw.print("</tr>");
pw.print("<td> " + "<a href='http://localhost:8080/servlet/game'> " +
"<img src='D:\\onlineshopping\\arw.jpg' align=left hight=20
width=20> " + "<font color=white size=4> " + "Games<b> " + "</a> "
+ "</td>");
pw.print("</tr>");
pw.print("</table>");
pw.print("<table border=1 bgcolor= #FDEEF4 align=left>");
pw.print("<tr>");
pw.print("<th> " + "<img
src='d:\\onlineshopping\\artistic1_21Aug[1].GIF' align=left> " + "<a
href='http://localhost:8080/servlet/art1'> " + "<font color=dark
orange> " + "Artistic Wall piecies <br> " + "</font> " + "<pre> ");
pw.print("ArtPanel-Hanger1 Rs. 254 ");
pw.print("</th>");
pw.print("</tr>");
pw.print("<tr>");
pw.print("<td> " + "<img src='d:\\onlineshopping\\art2.gif'
align=left> " + "<br> " + "<a href='http://localhost:8080/servlet/art2'>
" + "<pre> " );
pw.print("Art Panel-Hanger 2 Rs. 212 " + "</a> " + "</td> " +
"</tr>");
pw.print("<tr>");
pw.print("<th> " + "<img src='d:\\onlineshopping\\art3.jpg'
align=left> " + "<font color=dark orange> " + "Sculpture<br> " +
"</font> " + "<pre> " + "<a href='http://localhost:8080/servlet/art3'>
");
pw.print("Brass Art Panel Rs.2549");
pw.print("</th>");
pw.print("</tr>");
pw.print("<tr>");
pw.print("<td> " + "<img src='d:\\onlineshopping\\art4.jpg'
align=left> " + "<br> " + "<pre> " + "<a
href='http://localhost:8080/servlet/art4'>");
pw.print("Cross Ganesha Rs. 2500 " + "</a> " + "</td> " + "</tr>");
pw.print("</table>");
pw.print("<table border=1 bgcolor= #C6DEFF align=right>");
pw.print("<tr>");
pw.print("<th> " + "<img src='d:\\onlineshopping\\art5.jpg'
align=left> " + "<font color=dark orange> " + "<a
href='http://localhost:8080/servlet/art5'> " + " Art Mirrors<br> " + "
</font> ");
pw.print("<pre> " + "WroughtIronMirrorRs.5250 " + "</a> ");
pw.print("</th>");
pw.print("</tr>");
pw.print("<tr>");
pw.print("<td> " + "<img src='d:\\onlineshopping\\art6.jpg'
align=left> " + "<br> " + "<pre> " + "<a
href='http://localhost:8080/servlet/art6'> ");
pw.print(" Art Mirror(H) Rs. 1444 " + " </a>");
pw.print("</td> " + "</tr>");
pw.print("<tr>");
pw.print("<th> " + "<img src='d:\\onlineshopping\\hand1.jpg'
align=left> "+ "<font color=dark orange>");
pw.print("Hand Made Bags" + "</font> " + "<pre> " + "<a
href='http://localhost:8080/servlet/art7'>");
pw.print( " BrocadeJewelleryPouch Rs. 150 " + "</a>");
pw.print("</th>");
pw.print("</tr>");
pw.print("<tr>");
pw.print("<td> " + "<img src='d:\\pp1\\hand2.jpg' align=left><br> "
+ "<pre> " + "<a href='http://localhost:8080/servlet/art8'> ");
pw.print("Black Brocade Fold " + "</a> " + "</td> " + "</tr> " +
"</table>");
pw.print("<br><br><br><br><br><br><br><br><br><br><br><br>
");
pw.print("</body>");
pw.print("</html>");
}
}
Art4.java
import java.io.*;
import javax.servlet.*;
import java.sql.*;
pw.print("<html>");
pw.print("<body>");
pw.print("<form action='http://localhost:8080/servlet/pay'
name=f1>");
pw.print("<b> " + "<img src='d:\\onlineshopping\\a4.jpg' align=left>
" + "<br><br><br> " );
pw.print("<pre> " + " <font color=red size=5> " + "Offer Price
:Rs. Rs. 2500</font> " + "<br> " + "<br>");
pw.print(" EMI Available : Rs.833 for 3 months " + "<br>");
pw.print(" Warranty : Not Applicable " + "<br>");
pw.print(" Return Policy :Applicable ( 10 days Return Policy)
" + "<br>");
pw.print(" Shipping Time : Ships in 14 working days " +
"<br>");
pw.print(" Shipping Charges : 250.00 " + "<br>");
pw.print(" Shipping Location : All Cities " + "<br>");
pw.print(" Seller : <font color=blue> Harmony Decor Pvt.
Ltd. " + "<br> " + "</pre>");
pw.print("</body>");
pw.print("</html>");
}
}
Pay.java
import java.io.*;
import javax.servlet.*;
import java.sql.*;
int m=rest.getInt(1);
while(rest1.next())
{
n=Integer.parseInt(rest1.getString(1));
}
if(n>0)
{
pstat2=con.prepareStatement("update totaltemp set total=?");
pstat2.setInt(1,m);
pstat2.executeUpdate();
}
else
{
pstat2=con.prepareStatement("insert into totaltemp values(?)");
pstat2.setInt(1,m);
pstat2.executeUpdate();
}
}
catch(Exception e1)
{
System.out.println(e1);
}
import java.io.*;
import javax.servlet.*;
import java.sql.*;
String j;
j=req.getParameter("option");
if(j.equals("CreditCard"))
{
try
{
String k="credit";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con1=DriverManager.getConnection("jdbc:odbc:onlineshoping");
PreparedStatement pstat12=con1.prepareStatement("update itemtemp
set ccn=? where itemname=?");
pstat12.setString(1,k);
pstat12.setString(2,req.getParameter("h1"));
pstat12.executeUpdate();
}catch(Exception eee){}
else
{
Try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:onlineshoping");
PreparedStatement pstat1=con.prepareStatement("update itemtemp
set ccn='cash' where itemname=?");
pstat1.setString(1,req.getParameter("h1"));
pstat1.executeUpdate();
}catch(Exception eee){}
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:onlineshoping");
PreparedStatement pstat1=con.prepareStatement("select userID from
usertemp ");
ResultSet rst=pstat1.executeQuery();
rst.next();
String f=rst.getString(1);
PreparedStatement pstat2=con.prepareStatement("select
FirstName,LastName,Emailaddress,Contactno,Homeaddress, City
from newuser where userID=? ");
pstat2.setString(1,f);
ResultSet rst1=pstat2.executeQuery();
rst1.next();
String g=rst1.getString(1);
String h=rst1.getString(2);
String p=rst1.getString(3);
String k=rst1.getString(4);
String r=rst1.getString(5);
String b=rst1.getString(6);
pw.print(" <pre>");
pw.print(" <b>" + " Name:-" + "</b>" + "<font size=3 font
color=blue><b> " + g + "</b></font>");
pw.print("<font size=3 font color=blue><b> " + h + "</b></font>" +
"<br>");
pw.print(" <b>" + "Contactno:-" +" </b> " + " <font size=3
font color=blue><b> " + k + "</b></font>" + "<br>");
pw.print(" <b>" + " Emailaddress:-" + " </b> " + " <font
size=3 font color=blue><b>" + p + "</b></font>" + "<br>");
pw.print(" <b>" + " Homeaddress:-" + "</b> " + " <font
size=3 font color=blue><b> " + r + "</b></font>" + "<br>");
pw.print(" <b>" + " City:-" + " </b> " + "<font size=3 font
color=blue><b> " + b +"</b></font>" + "<br>");
pw.print("</pre>");
}
catch(Exception e)
{
System.out.println(e);
}
pw.print("<br>");
pw.print("<br>");
pw.print("<br>");
pw.print("<br>");
pw.print("<pre>");
pw.print(" <input type=Submit
value=Changeaddress style=color:white;background:green
name=b2>");pw.print(" </form> ");
pw.print("<form action=" + "http://localhost:8080/servlet/cash" +
">");
pw.print(" <input type=submit
value=Continue style=color:white;background:green
name=b3>");pw.print(" </form> ");
pw.print("</pre>");
pw.print(" </body> ");
pw.print(" </html> ");
}
}
}
Cmpr.java
import java.io.*;
import javax.servlet.*;
import java.sql.*;
pstat1.setString(1,req.getParameter("t2"));
pstat1.setString(2,req.getParameter("t3"));
ResultSet rst=pstat1.executeQuery();
while( rst.next())
{
i++;
}
}
catch(Exception e2)
{
}
if(i>0)
{
try
{
PreparedStatement pstat2=con.prepareStatement("insert into
banktemp values(?,?)");
pstat2.setString(1,req.getParameter("t2"));
pstat2.setString(2,req.getParameter("t3"));
pstat2.executeUpdate();
}
catch(Exception e)
{
}
try
{
Statement stat1=con.createStatement();
Statement stat2=con.createStatement();
pw.print("<center>");
pw.print("<font color=red>" + rest1.getString(2) + "</font>" + ",You
are transacting on a secure shopping server.");
pw.print("</center>");
pw.print("<br>");
pw.print(" <center> ");
pw.print("<table border=3 bordercolor=orange cellpadding=8>" );
pw.print("<tr>");
pw.print("<td>");
pw.print("ItemName" + "</td>" + "<td>");
pw.print("Price" + "</td>" + "<td>");
pw.print("Quantity" + "</td>" + "<td>");
pw.print("SubTotal" + "</td>" + "</tr>");
z=0;
while(rest2.next())
{
pw.print("<tr>");
pw.print("<td>");
itemlst[z]=rest2.getString(1);
pw.print("
");
Del.java
import java.io.*;
import javax.servlet.*;
import java.sql.*;
import java.util.Date;
import java.text.*;
public class del extends GenericServlet
{
public void service(ServletRequest req,ServletResponse res) throws
IOException,ServletException
{
res.setContentType("text/html");
PrintWriter pw=res.getWriter();
/*pw.print("<html>");
pw.print("<body>");
pw.print("<form action='http://localhost:8080/servlet/cmpr'>");
pw.print("<input type=submit value=back>");
pw.print("</form>");
pw.print("</body>");
pw.print("</html>");*/
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:onlineshoping");
PreparedStatement pstat1=con.prepareStatement("delete from
itemtemp where itemname=?");
String ss=req.getParameter("s1");
pstat1.setString(1,ss);
pstat1.executeUpdate();
}catch(Exception dd){}
}
}
Changeadd.java
import java.io.*;
import javax.servlet.*;
import java.sql.*;
public class changeadd extends GenericServlet
{
public void service(ServletRequest req,ServletResponse res) throws
IOException,ServletException
{
res.setContentType("text/html");
PrintWriter pw=res.getWriter();
int i=0;
if(req.getParameter("t1").length()==0)
{
pw.print("fill all the information");
}
else if(req.getParameter("t2").length()==0)
{
pw.print("fill all the information");
}
else if(req.getParameter("t3").length()==0)
{
pw.print("fill all the information");
}
else if(req.getParameter("t4").length()==0)
{
pw.print("fill all the information");
}
else
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:onlineshoping");
PreparedStatement pss=con.prepareStatement("select * from newuser
where userID=? and Password=?");
pss.setString(1,req.getParameter("t5"));
pss.setString(2,req.getParameter("t6"));
ResultSet rr=pss.executeQuery();
while(rr.next())
{
i++;
}
if(i>0)
{
}
}
Last.java
import java.io.*;
import javax.servlet.*;
import java.sql.*;
import java.util.Date;
import java.text.*;
public class last extends GenericServlet
{
public void service(ServletRequest req,ServletResponse res) throws
IOException,ServletException
{
res.setContentType("text/html");
PrintWriter pw=res.getWriter();
String un,ccn,an,bn,id;
Date dt=new Date();
DateFormat
df=DateFormat.getDateInstance(DateFormat.DEFAULT);
String d=df.format(dt);
Connection con;
int i=0;
int k=0,a=0;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:onlineshoping");
PreparedStatement pstat6=con.prepareStatement("select
sum(subtotal) from itemtemp");
ResultSet rest6=pstat6.executeQuery();
rest6.next();
k=rest6.getInt(1);
rest6.next();
an=rest6.getString(1);
ccn=rest6.getString(2);
if(a>=k)
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:onlineshoping");
Statement stat1=con.createStatement();
ResultSet rest=stat1.executeQuery("select * from genid");
rest.next();
i=rest.getInt(1);
i++;
PreparedStatement pstat=con.prepareStatement("update genid set
Orderno=?");
pstat.setInt(1,i);
pstat.executeUpdate();
}
catch(Exception e)
{
System.out.println(e);
}
pw.print(" <center> ");
pw.print("Your Order No is" + i);
pw.print("<br>");
pw.print("<br>");
pw.print(" when You not get your order you can claim on the behalf of
orderno");
pw.print("<br>");
pw.print("<font size=5 color=red> " + " THANK YOU FOR
PURCHASING " + "</font> ");
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:onlineshoping");
PreparedStatement pstat1=con.prepareStatement("select * from
usertemp");
ResultSet rest1=pstat1.executeQuery();
rest1.next();
id=rest1.getString(1);
un=rest1.getString(2);
pstat1=con.prepareStatement("select * from banktemp");
ResultSet rest2=pstat1.executeQuery();
rest2.next();
an=rest2.getString(1);
ccn=rest2.getString(2);
pstat1.setString(5,rest3.getString(1));
pstat1.setInt(6,Integer.parseInt(rest3.getString(2)));
pstat1.setInt(7,Integer.parseInt(rest3.getString(3)));
pstat1.setString(8,rest3.getString(5));
pstat1.executeUpdate();
}
PreparedStatement pstat2=con.prepareStatement("select
sum(subtotal) from itemtemp where ccn='credit'");
ResultSet rest4=pstat2.executeQuery();
rest4.next();
int t=rest4.getInt(1);
Statement pstat3=con.createStatement();
/*
pstat3.setString(1,an);
pstat3.setString(2,ccn);*/
Statement pstat4=con.createStatement();
pstat4.executeUpdate("delete from banktemp");
Statement pstat31=con.createStatement();
//pstat3=con.prepareStatement("delete from itemtemp");
pstat31.executeUpdate("delete from itemtemp");
/*pstat3.setString(1,rest3.getString(1));
pstat3.setInt(2,Integer.parseInt(rest3.getString(2)));
pstat3.setInt(3,Integer.parseInt(rest3.getString(3)));
pstat3.setInt(4,Integer.parseInt(rest3.getString(4)));
pstat3.executeUpdate();*/
//pstat3=con.prepareStatement();
//pstat3.setInt(1,t);
Statement pstat5=con.createStatement();
pstat5.executeUpdate("delete from totaltemp");
}
catch(Exception e1)
{
System.out.println(e1);
}
}
else
{
pw.print("you have no sufficiant ammount");
}
pw.print("</body>");
pw.print("</html>");
}}
Cash.java
import java.io.*;
import javax.servlet.*;
import java.sql.*;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:onlineshoping");
Statement stat1=con.createStatement();
Statement stat2=con.createStatement();
}
pw.print("</table>") ;
pw.print("</center>");
rest.next();
int m=rest.getInt(1);
pw.print("<br> ");
pw.print("<br> ");
pw.print("<pre>");
pw.print(" Total=" + m);
pw.print("</pre>");
}
catch(Exception e)
{
}
pw.print(" <center> ");
pw.print("<br> ");
pw.print("<br> ");
pw.print("<br> ");
pw.print("<br> ");
}
Cashlast.java
import java.io.*;
import javax.servlet.*;
import java.sql.*;
import java.util.Date;
import java.text.*;
public class cashlast extends GenericServlet
{
public void service(ServletRequest req,ServletResponse res) throws
IOException,ServletException
{
res.setContentType("text/html");
PrintWriter pw=res.getWriter();
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:onlineshoping");
Statement stat1=con.createStatement();
ResultSet rest=stat1.executeQuery("select * from genid");
rest.next();
i=rest.getInt(1);
i++;
PreparedStatement pstat=con.prepareStatement("update genid set
Orderno=?");
pstat.setInt(1,i);
pstat.executeUpdate();
}
catch(Exception e)
{
System.out.println(e);
}
pw.print(" <center> ");
pw.print("<pre>");
pw.print("<b> " + "Your Order No is " + i);
pw.print("</pre>");
pw.print(" when You not get your order you can claim on the behalf of
orderno");
pw.print("<br>");
pw.print("<font size=5 color=red> " + " THANK YOU FOR
PURCHASING " + "</font> ");
int ttl=0;
String ccstr="";
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:onlineshoping");
Statement pstat1=con.createStatement();
PreparedStatement sts=con.prepareStatement("select sum(subtotal)
from itemtemp where ccn=?");
String sss="credit";
sts.setString(1,sss);
ResultSet rr=sts.executeQuery();
Statement sts1=con.createStatement();
ResultSet rr1=sts1.executeQuery("select CCN from banktemp");
while(rr.next())
{
pw.print(" KKKKK");
ttl=rr.getInt(1);
}
while(rr1.next())
{
pw.print("QQQ");
//pw.print(rr1.getString(1));
ccstr=rr1.getString(1);
PreparedStatement p1=con.prepareStatement("update Account set
Ammount=Ammount-? where CCN=?");
p1.setInt(1,ttl);
p1.setString(2,ccstr);
p1.executeUpdate();
pw.print("zzz");
}
ResultSet rest1=pstat1.executeQuery("select * from usertemp");
rest1.next();
id=rest1.getString(1);
un=rest1.getString(2);
Statement pstat8=con.createStatement();
pstat9.setString(5,rest3.getString(1));
pstat9.setInt(6,Integer.parseInt(rest3.getString(2)));
pstat9.setInt(7,Integer.parseInt(rest3.getString(3)));
pstat9.setString(8,rest3.getString(5));
//psta1.setString(9,rest3.getString(6));
pstat9.executeUpdate();
}
Statement pstat31=con.createStatement();
}
catch(Exception e1)
{
System.out.println(e1);
}
pw.print("</body>");
pw.print("</html>");
}}
Logout.java
import java.io.*;
import javax.servlet.*;
import java.sql.*;
pw.print("<html>");
pw.print("<body>");
pw.print("<p align=right> " + " <a
href='http://localhost:8080/servlet/front> " + "<font
color=#15317E><b> " + " HOME</a> " + " ");
pw.print("<a href='http://localhost:8080/servlet/aboutus'> " + " <font
color=#15317E><b> " + " ABOUT US</a> " + " " + "
<a href=> " + " <font color=#15317E><b> " + " FEEDBACK</a> " +
" </p> " + " <img src='d:\\onlineshopping\\india.jpg'> ");
pw.print(" <hr width=100% color=#3BB9FF size=4>");
pw.print("<img src='D:\\onlineshopping\\sidelogo.jpg' align=left> " +
" <img src='D:\\onlineshopping\\sidelogo.jpg' align=right>" + "
<br><br>");
pw.print("
");
pw.print("<font size=10 color=#347C17 ><b> " + " <i>ONLINE
SHOPPING</i></b> " + " </font>");
pw.print("<hr width=100% color=orange size=2 >");
pw.print("<font color=#15317E><b> " + " <a
href='http://localhost:8080/servlet/registration1'> " + " New user</a>
" + " " + " <font color=#15317E> " + " <a
href='http://localhost:8080/servlet/regis'><b> " + " Registered
user</a> " + " " + " <font color=#15317E> " + " <a
href='http://localhost:8080/servlet/accountinfo'><b> " + "
MyAccount</a>");
pw.print("
&
nbsp; &nb
sp;
&
nbsp; &nb
sp; ");
pw.print("
&
nbsp; &nb
sp;
&
nbsp; &nb
sp; " + " <font color=#15317E><b> " + " <a
href='http://localhost:8080/servlet/logout'> " + " logout</a>");
pw.print("<hr width=100% color=#3BB9FF size=10 >");
pw.print("<marquee > " + " <font color=orange size=3><b> " + "
Welcome to Online Shopping " + " </font> " + " </marquee> " + "
<br><br><br><br>");
pw.print("</table>");
pw.print("<table border=2 bgcolor= white align=right cellpadding=2
cellspacing=2 >");
pw.print("<th> " + " <font size=6 color=#347C17><b> " +
"Electronics goods " + "</font> " + " </th>");
pw.print("<tr> " + "<td> " + " <a
href='d:\\onlineshopping\\ece.html'> " + "<img
src='D:\\onlineshopping\\tv1.jpg'> " + "</a> ");
pw.print(" ");
pw.print("<a href='d:\\onlineshopping\\mobile.html'> " + "<img
src='D:\\onlineshopping\\mb2.jpg'></a>");
pw.print(" ");
pw.print("<a href='d:\\onlineshopping\\dvd.html'> " + "<img
src='D:\\onlineshopping\\dvd2.jpg'> " + " </a> ");
pw.print(" ");
pw.print("<a href='d:\\onlineshopping\\ece.html'> " + "<img
src='D:\\onlineshopping\\lp1.jpg'> " + "</a> " + "</td> " + "</tr>");
pw.print("<th> " + "<font size=6 color=#347C17><b> " + "Art &
Games</b> " + "</font>");
pw.print("<tr> " + "<td> " + "<a href='d:\\onlineshopping\\art.html'>
" + "<img src='D:\\onlineshopping\\art1.jpg'> " + "</a>");
pw.print("<a href='d:\\onlineshopping\\games.html'> " + "<img
src='D:\\onlineshopping\\gm1.jpg'> " + "</a>");
pw.print("<a href='d:\\onlineshopping\\art.html'> " + "<img
src='D:\\onlineshopping\\art2.jpg'> " + "</a>");
pw.print("<a href='d:\\onlineshopping\\games.html'> " + "<img
src='D:\\onlineshopping\\gm2.jpg'> " + "</a> " + "</td> " + "</tr> "
+ "</table>");
pw.print("<img src='d:\\onlineshopping\\cata.jpg' align=left> " +
"<br><br><br>");
pw.print(" <table border=0 bgcolor= #56A5EC align=left
width=190>");
pw.print("<tr>");
pw.print("</body>");
pw.print("</html>");
}
}
Aboutus.java
import java.io.*;
import javax.servlet.*;
import java.sql.*;
pw.print("<html>");
pw.print("<body><p align=right> " + "<a
href='http://localhost:8080/servlet/front'> " + "<font
color=#15317E><b> " + "HOME</a> " + " ");
pw.print("<a href='http://localhost:8080/servlet/aboutus'> " + "<font
color=#15317E><b>" + "ABOUT US</a> " + " " + "<a
href='http://localhost:8080//servlet//feedback'> " + "<font
color=#15317E><b>" + "FEEDBACK</a> " + "</p>");
pw.print( "<img src='d:\\onlineshopping\\india.jpg'>");
pw.print("<hr width=100% color=#3BB9FF size=4>");
pw.print("<marquee bgcolor=#4E4848> " + " <font color=white font
size=4> " + " ABOUT US " + "</font> " + "</marquee>");
pw.print("<br> " + " <br>");
pw.print("<h1> " + "about us </h1>");
pw.print("Want to buy the best? Then opt for indiainfo.com. Visit this
online shopping site of and");
pw.print(" choose from the wide collection of apparels, books,
confectioneries, electronics, flowers,");
pw.print(" movies, toys and lots more. This online shopping store
brings for you the best and branded");
pw.print(" products. Enjoy buying online." + "</p>");
pw.print("<html>");
pw.print("<body>");
pw.print("<br><br>");
pw.print("<table bgcolor=#3399FF>");
pw.print("<tr> " + " <td>");
pw.print("</td> " + " </tr> " + " </table> " + " <br><br>");
pw.print("<table cellSpacing=0 cellPadding=0 width=100%
border=.5>");
pw.print("<tr>");
pw.print("<td> " + " <br>");
pw.print("<pre><font size=4>" + " <b> Feedback Form </b> " + "
</font> " + " </pre><pre> ");
pw.print("<form action='http://localhost:8080/servlet/feedback2'>");
pw.print(" <strong>Name</strong> <input Type=Text name=t1
size=15> " + "<br><br>");
pw.print(" <strong>Email id</strong> " + " <input Type=Text
name=t2 size=15> " + " <br><br>");
pw.print(" <strong>Enter Your Comments:<strong> " + " <br>");
pw.print(" <textarea wrap=virtual name=t3 rows=10
cols=40 maxlength=100> " + " </textarea> " + " <br>");
pw.print("</body>");
pw.print("</html>");
}
}
Feedback2.java
import java.io.*;
import javax.servlet.*;
import java.sql.*;
import java.util.Date;
import java.text.*;
public class feedback2 extends GenericServlet
{
public void service(ServletRequest req,ServletResponse res)throws
IOException,ServletException
{
res.setContentType("text/html");
PrintWriter pw=res.getWriter();
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:onlinebanking");
PreparedStatement pstat=con.prepareStatement("insert into feedback
values(?,?,?,?,?)");
pstat.setString(1,req.getParameter("t2"));
pstat.setString(2,req.getParameter("t1"));
pstat.setString(3,req.getParameter("t3"));
pstat.setString(4,w);
pstat.setString(5,r);
pstat.executeUpdate();
pw.print("<font size=5 font color=blue><b>ThankYou</b></font>");
}
catch(Exception e){System.out.println(e+ "DCFG");}
}
}
Tables
newuser
usertemp
userID FirstName
jm jyoti
itemtemp
AN CCN
11111 123
Account
AN CCN Accountholder Ammount
11111 123 pratibha 39153
11112 234 jyoti 3207780
genid
Orderno
5
purchase
Orderno userID FirstName Date ItemName Price Quantity ccn
12 pratibha pratibha Oct 18, 2009 Krishna 262 1 credit
12 pratibha pratibha Oct 18, 2009 CrossGanesha 2500 1 cash
15 pratibha pratibha Oct 18, 2009 ArtMirror 1699 1 credit
16 pratibha pratibha Oct 19, 2009 ArtPanelHanger2 249 1 credit
16 pratibha pratibha Oct 19, 2009 LostSymbol 524 1 cash
21 pratibha pratibha Oct 20, 2009 ArtPanelHanger2 249 1 cash
21 pratibha pratibha Oct 20, 2009 ArtPanelHanger1 299 1 cash
23 pratibha pratibha Oct 20, 2009 ArtPanelHanger2 249 1 cash
31 pratibha pratibha Oct 20, 2009 ArtPanelHanger1 299 1 credit
31 pratibha pratibha Oct 20, 2009 BrassArtPanel 2999 1 cash
32 pratibha pratibha Oct 20, 2009 ArtPanelHanger1 299 1 credit
32 pratibha pratibha Oct 20, 2009 ArtPanelHanger2 249 1 cash
33 pratibha pratibha Oct 20, 2009 ArtPanelHanger1 299 1 credit
33 pratibha pratibha Oct 20, 2009 ArtPanelHanger2 249 1 credit
12 pratibha pratibha Oct 18, 2009 BrocadeJwelleryPouch 150 2 credit
P4 Processor
2 GB RAM
250 GB Harddisk
Software Requirement:-
Servlets are actually simple Java classes which must implement the
javax.servlet.Servlet interface. This interface contains a total of
five methods. Most of the time you don't need to implement this
interface. Why? Because javax.servlet package already provides
two classes which implement this interface i.e. GenericServlet and
HttpServlet. So all you need to do is to extend one of these
classes and override the method(s) you need for your Servlet.
GenericServlet is a very simple class which only implements the
javax.servlet.Servlet interface and provides only basic
functionality. On the other hand, HttpServlet is a more useful class
which provides methods to work with the HTTP protocol. So if your
Servlet works with HTTP protocol (in most cases this will be the
case) then you should extend javax.servlet.http.HttpServlet
class to build Servlets .
Lifecycle of a servlet
The servlet lifecycle consists of the following steps:
There will be only one serveltcontext object for the entire web
application. servletcontext object was created by the container if it
is the first request form the client other wise it will create the
reference of the existed object.
Servlet containers
A servlet container is a specialized web server that supports servlet execution. It
combines the basic functionality of a web server with certain Java/servlet specific
optimizations and extensions – such as an integrated Java runtime environment, and
the ability to automatically translate specific URLs into servlet requests. Servlet
containers are also referred to as web containers or web engines.
RMI
Remote Method Invocation (RMI) facilitates object function calls between Java
Virtual Machines (JVMs). JVMs can be located on separate computers - yet one JVM
can invoke methods belonging to an object stored in another JVM. Methods can even
pass objects that a foreign virtual machine has never encountered before, allowing
dynamic loading of new classes as required. This is a powerful feature!
Java RMI provides a very easy solution! Since RMI can dynamically load new classes, Developer B
can let RMI handle updates automatically for him. Developer A places the new classes in a web
directory, where RMI can fetch the new updates as they are required.
Figure 1 shows the connections made by the client when using RMI. Firstly, the client must contact
an RMI registry, and request the name of the service. Developer B won't know the exact location of
the RMI service, but he knows enough to contact Developer A's registry. This will point him in the
direction of the service he wants to call..
Developer A's service changes regularly, so Developer B doesn't have a copy of the
class. Not to worry, because the client automatically fetches the new subclass from a
webserver where the two developers share classes. The new class is loaded into
memory, and the client is ready to use the new class. This happens transparently for
Developer B - no extra code need to be written to fetch the class.
JDBC Architecture
Java applications cannot directly communicate with a database to submit data and
retrieve the results of queries. This is because a database can interpret only SQL
statements and not java language statements. For this reason,you need a mechanism to
translate java statements into SQL statements.
The JDBC architecture can be classified into two layers:
1) JDBC architecture layer
2) JDBC driver layer
JDBC Drivers:-
When you develop JDBC applications, you need to use JDBC drivers to convert
queries into a form that a particular database can interpret. The JDBC Driver also
retrieves the result of SQL statements and converts the result into equivalent JDBC
API class objects that the java application uses. As the JDBC driver only take care of
interactions with the database, any change made to the database does not affect the
application. JDBC supports 4 types of drivers they are:-
1) JDBC-ODBC Bridge driver
2) Native API Partly java driver
3) JDBC-Net Pure java driver
4) Native Protocol Pure java driver
Loadind a Driver:-
The first step to develop a JDBC application is to load and register the required
driver using the driver manager. You can load and register a driver:
Programmaticaly :-
1) Using a forname() method
2) Using a registeredDriver() method
Manually:-
1) By setting system property
DATAGRAMS
Datagrams are bundles of information passed between machines. They are
somewhatlike a hard throw from a well-trained but blindfolded catche to the third
baseman. Once the datagram has been released to its intended target, there is no
assurance that it will arrive or even that someone will be there to catch it. Likewise,
when the datagram is received, there is no assurance that it has’t been damaged in
tranist or that whoever sent it is still there to receive a response.
Java implements datagrams on top of the UDP protocol by using two classes.The
DatagramPacket object is the data container,while the DatagramSocket is the
mechanism ued to send or receive the DatagramPavkets.