Home Answers Viewqa WebSevices sample jsp-servlet-service-db program

 
 


Http Servlet
sample jsp-servlet-service-db program
0 Answer(s)      a year and a month ago
Posted in : WebSevices

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Create New Inventory Manager</title>
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript">
function validation()
{

    var name1=inventory.name1.value;
var addr1=inventory.addr1.value;
var number=inventory.cnum.value;
var x=document.forms["inventory"]["name2"].value;
var atpos=x.indexOf("@");
var dotpos=x.lastIndexOf(".");
var sub;
var rand;


if(name1.length==0)
{
alert("Enter your Name");
inventory.name1.focus();
return false;
}

if(addr1.length<20)
{
alert("Enter your address(minimum 20 characters)");
inventory.addr1.focus();
return false;
}
if ((atpos<1) || (dotpos<atpos+2) || (dotpos+2>=x.length))
{
alert("Not a valid e-mail address");
inventory.name2.focus();
return false;
}

if(number.length<10)
{
alert("Enter your 10 digit Contact Number");
inventory.cnum.focus();
return false;
}
sub= onsubmitform();

}

function isNumberKey(evt)
{
   var charCode = (evt.which) ? evt.which : event.keyCode;
   if ((charCode > 31) && (charCode < 48) || (charCode > 57))
      return false;

   return true;
}
function isNumberKey1(evt)
{
   var charCode = (evt.which) ? evt.which : event.keyCode;
   if (charCode > 31 && (charCode < 48) || (charCode > 57))
      return true;

   return false;
}
function onsubmitform()
 {
  alert("Account created successfully!");
   }
</script>
</head>
<body bgcolor=silver>
<form method ="post" name="inventory" action="CreateIm" onsubmit="return validation()">
 <center> Enter the Inventory Manager Details</center>
 <table border="0" cellpadding="0" cellspacing="0">

 <tr>
 <td>Inventory Manager name: </td>
<td><INPUT id="txtChar" onkeypress="return isNumberKey1(event)" type="text" name="name1"></td>
 </tr>
 <tr>
 <td>Address:</td>
 <td><textarea rows="2" cols="20" name="addr1"></textarea></td>
 </tr>
 <tr>
 <td>E-mail ID: </td>
<td><input type="text" name="name2" size="20"/></td>
 </tr>
 <tr>
 <td>Phone No.: </td>
<td> <INPUT maxlength = 10 id="txtChar" onkeypress="return isNumberKey(event)" type="text" name="cnum">
</td>
 </tr>
 <tr>
 <td> </td>
 <td><input type="submit" value="Submit"/>
 <input type="reset" name="B2" value="Reset"/></td>
 </tr>
 </table>


 </form>      
</body>
</html>





<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ page import="java.lang.*" %>

    <%@ page import="java.util.ArrayList" %>
    <%@ page import="java.sql.*"%>
    <%@ page import="com.ilp.tsi.db.DB" %>
    <%@ page import="com.ilp.tsi.um.beans.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
<script src="http://code.jquery.com/jquery-latest.js"></script>
  <script type="text/javascript" src="http://jzaefferer.github.com/jquery-validation/jquery.validate.js"></script>

  <script>
  function validation()
  {

    var name1=edit.user.value;
  var addr1=edit.add.value;
  var number=edit.num.value;
  var x=document.forms["edit"]["email"].value;
  var atpos=x.indexOf("@");
  var dotpos=x.lastIndexOf(".");
  var sub;



  if(name1.length==0)
  {
  alert("Enter your Name");
  edit.user.focus();
  return false;
  }

  if(addr1.length<20)
  {
  alert("Enter your address(minimum 20 characters)");
 edit.add.focus();
  return false;
  }
  if ((atpos<1) || (dotpos<atpos+2) || (dotpos+2>=x.length))
  {
  alert("Not a valid e-mail address");
 edit.email.focus();
  return false;
  }

  if(number.length<10)
  {
  alert("Enter your 10 digit Contact Number");
edit.num.focus();
  return false;
  }
}

  function openPage(pageURL)  {  window.location.href = pageURL;  } 

  function isNumberKey(evt)
    {
       var charCode = (evt.which) ? evt.which : event.keyCode;
       if ((charCode>31) && (charCode<48) || (charCode>57))
          return false;

       return true;
    }
    function isNumberKey1(evt)
    {
       var charCode = (evt.which) ? evt.which : event.keyCode;
       if (charCode>31 && (charCode<48 || charCode>57))
          return true;

       return false;
      }
      </script>


</head>
<body>

<h2 align="center">Retailer Details</h2>


<center><form method="post" id="edit" name="edit" action="EditRetailer" onsubmit="return validation()" >
<%
Connection conn=null;
Statement stmt=null;
try
{

    DB obj=new DB();

    conn=obj.getConnection();
    stmt=conn.createStatement();
    ResultSet rs=null;
    ResultSet rs1=null,rs2=null;;
    //RetBean rbean=new RetBean();

    String retId=(String)session.getAttribute("retId");

    rs=stmt.executeQuery("select * from retailer where RETAILER_ID='"+retId+"'");
    while(rs.next())
    {

    %>

<table border="0" cellspacing="5" cellpadding="5">

<tr>
<td>Retailer Name:</td>
<td><input type="text" name="user" onkeypress="return isNumberKey1(event)" class="Retailer name required"  value="<%= rs.getString("retailer_name") %>"></input></td>
</tr>
<tr>
<td>Address:</td>
<td><textarea rows="1" cols="20" name="add" class="address required"  ><%= rs.getString("address")%></textarea></td>
</tr>
<tr>
<td>Email ID:</td>
<td><input type="text" name="email" class="email required" value="<%= rs.getString("email_id")%>"></input></td>
</tr>
<tr>
<td>Contact Number:</td>
<td><input type="text" name="num" onkeypress="return isNumberKey(event)" class="contact number required" size="10" value="<%= rs.getString("contact_no")%>"></input></td>
</tr>
<tr><th align="left">Tagged retailer products</th></tr>
<%
}


rs1=stmt.executeQuery("select product.prod_model_name,product.product_id from ret_prod inner join product  on ret_prod.product_id=product.product_id where retailer_id='"+retId+"'");
while(rs1.next())
{

%>
<tr>

<td></td>

<td><%=rs1.getString("prod_model_name") %></td>
</tr>
<%
//rs2=stmt.executeQuery("insert into ret_prod values ('"+retId+"','"+rs1.getString("product_id")+"')"); 
}
%>
<tr>
<td><input type="button" value="Product Catalog" onclick="openPage('tags.jsp')"></input></td>

<td><input type="submit"  value="update" name="Edit1"></input></td>
<td><input type="button" value="untag"  onclick="openPage('untag.jsp')"></input></td>
<td><input type="button" value="delete" onclick="openPage('deleteretailer.jsp')"></input></td>
</tr>
</table>
</form>
<%
conn.close();
stmt.close();
}
catch(SQLException E)
{
    E.printStackTrace();
}

%>





</center>
</body>
</html>






<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> Retailer Home  </title>
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript">
window.history.forward();
function noBack()
{
    windows.history.forward();
}
</script>
</head>
<body onload="noBack();" onPageshow="if(event.resisted)noBack();" onunload="">
<font>
<p align="right"><a href=changeRetPassword.jsp>Change Password</a>&nbsp&nbsp<a href=welcome.jsp>Logout</a></p>
<h1 align="center">Retailer Home Page </h1>

<%@page language="java" session="true" %>
<% 


session.setMaxInactiveInterval(60);
%>




<table align="center"  cellpadding="10" cellspacing="2" border="3">
            <tr height ="50">
                <td width="220" align="center" bgcolor="#FAEBD7">
                    <input type="button" onclick="window.location = 'viewListModels.jsp';" value="View list of models "  style="height: 1.5cm;width:5cm;" >
                </td>
            </tr>
            <tr height="50">
                <td width="220" align="center" bgcolor="#FAEBD7">
                    <input type="button" onclick="window.location = 'orderPlacing.jsp';" value="Order Products "  style="height: 1.5cm;width:5cm;" >
                </td>
            </tr>
            <tr height ="50">
                <td width="220" align="center" bgcolor="#FAEBD7">
                    <input type="submit" onclick="window.location = 'deleteOrder.jsp';" name="upViewAll" value="Cancel the order"  style="height: 1.5cm;width:5cm;"/>
                </td>
            </tr>
            <tr height ="50">
                <td width="220" align="center" bgcolor="#FAEBD7">
                    <input type="submit" onclick="window.location = 'pdate_customer_info1.jsp';" name="productnameDB" value="Update customer information"  style="height: 1.5cm;width:5cm;" >
                </td>
            </tr>
            <tr height ="50">
                <td width="220" align="center" bgcolor="#FAEBD7">
                    <input type="submit" onclick="window.location = 'checkShipment.jsp';" name="productnameDB" value="Check status of shipment"  style="height: 1.5cm;width:5cm;" >
                </td>
            </tr>
            <tr height ="50">
                <td width="220" align="center" bgcolor="#FAEBD7">
                    <input type="submit" onclick="window.location = 'defectReplace.jsp';" name="productnameDB" value="Defect Replacement"  style="height: 1.5cm;width:5cm;" >
                </td>
            </tr>
            <tr height ="50">
                <td width="220" align="center" bgcolor="#FAEBD7">
                    <input type="submit" onclick="window.location = 'viewListOrders.jsp';" name="productnameDB" value="View List of orders"  style="height: 1.5cm;width:5cm;" >
                </td>

            </tr>
        </table>



</font>

</body>
</html>
View Answers









Related Pages:
sample jsp-servlet-service-db program
sample jsp-servlet-service-db program  <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>...; <% Connection conn=null; Statement stmt=null; try { DB obj=new DB
sample Applet program
sample Applet program  I need Source Code for sample Applet program.   Hi Friend, Please visit the following link: Applet Tutorials Thanks
Sample java program
Sample java program  I want a sample program: to produce summary information on sales report. The program will input Data of Salesman Id, Item code, and number of cuestomer. Sales id is 5digit long, and items code range from
Axis2 sample program
for the service: C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\axis2\WEB-INF...: The services.xml file cannot be found for the service: C:\Program Files\Apache Software...Axis2 sample program  Hi.. I have tried the HelloWorldServie example
Sample program of JSP
Sample program of JSP  <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org
Sample program of JSP
Input program in JSP  <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org
Ajax sample
Ajax sample  Hi, Where I can find the samples of Ajax program? Thanks   Hi, Please see Ajax Tutorials. Thanks
java sample program - Java Beginners
java sample program  hai i need a sample program for polymorphism  Hi Friend, Try the following code: class Shape { int x,y; void area(){ } } class Square extends Shape { int l=2; void area
HQL Sample
HQL Sample In this site there are many tutorials and example of HQL. These examples comes with HQL sample code that you can download and run on your computer and learn the HQL by modifying and executing these examples. The HQL Sample
Sample Code - Development process
Sample Code   Hi Friend, Give sample code DTO... into a data transfer object (DTO) that can be sent with a single call to the Web service... that you have to program. DataSet provides convenient functions to load the DTO
java sample code - Java Beginners
java sample code  hai...... i need a full sample program fo inheritance.........  Hi Friend, Please visit the following link: http://www.roseindia.net/java/language/inheritance.shtml Thanks
Getting Exception on UseDefinedException sample program - Please help me how to resolve
Getting Exception on UseDefinedException sample program - Please help me how to resolve  class UseDefinedException extends Exception{ String msg = ""; int marks; public UseDefinedException() ){ } public
program
program  sample jsp programs for beginners.......   Hi, Please read at http://www.roseindia.net/jsp/jspfundamentals.shtml Thanks
Java sample using - for loop, if then else etc etc
Java sample using - for loop, if then else etc etc  sample program to produce summary information on sales report. The program will input Data of Salesman Id, Item code, and number of cuestomer. Sales id is 5digit long
Collection of Large Number of Java Sample Programs and Tutorials
Collection of Large Number of Java Sample Programs and Tutorials Java... example of java program is provided that shows you how you can...; HelloWorld Java Program Simple
Jsp program
Jsp program  A sample program of jsp using dml quaries
The Sample Banner Example in Java
Java - The Sample Banner Example in Java   .... In this program we will see how to display the banner in applet. This example has... that. There are four types of method have been used in this program these are explained below
JSF Sample Programs
JSF Sample Programs  I need a JSF sample programs
sample code - WebSevices
sample code  Hi Guys, can any body tell me use of webservices ? I want a sample code using xml with one application server bea weblogic and webserver tomcat   Hi Friend, Please visit the following link
java program
java program  write a java script program that would input the ff:Student Name,Average,Tuition Fee and output Total Tuition Fee. Formula: Total... 10% 84 and below no discount Sample Output: Student Name:_ Average:_ Tuition Fee
Need sample code
Need sample code  Need code for graph which shows the performance comparission of aprior algorithm and coherent rule algorithm.plz can any one help me i need in a week
error in sample example
error in sample example  hi can u please help me XmlBeanFactory class is deprecation in java 6.0 so, pls send advance version class   Use XmlBeanFactory(Resource) with an InputStreamResource parameter
GLImageProcessing iphone sample
GLImageProcessing iphone sample  Hi, From where I can download the GLImageProcessing example for iPhone? Thanks   Hi, The GLImageProcessing sample for iPhone shows how to use OpenGL ES libraries to bright, sharp
java program
java program  Problem 1 Write a javaScript program that would input Employee Name, rate per hour, No. of hours worked and will compute the daily wage... worked plus OT pay Sample Output: Employee Name:__ Rate per hour:__ No.of
java program
java program  write a java script program that would input the ff... and below no discount   write a java script program that would...% 84 and below no discount   write a java script program
Sample Ajax Code
Sample Ajax Code  Sample Ajax Code for getting values from another JSP   The below code is helpful to access another Action class //In Main JSP file var xmlHttpObj,xmlHttpObj1; function getXmlHttpObject() { var
program in array
program in array  print("code sample");write a program that initializes an array with ten random integers and then prints four lines of output,containing:every element at an even index,every even element,all elements in reverse
catalogue program
catalogue program  emphasized textHello can any one help me with this program,i'm new to java need some help,thank you! This program should allow..., then calculate the user's final bill, including taxation at 20%. A sample run
Java Program
in the second sample input. The destination can be considered an empty cell... than or equal to one. In the sample matrix, the only path for the box to move.... Sample Test Cases Test Case 1 Input: 5 5 @@@D@ @##@@ @##@@ MB
Java Program
Java Program  Problem Statement You are required to write a program... given, then your program must create the expression: 8 - 5 * 2 = -2 Here... Sample Test Cases Test Case 1 Input: 4 8 5 2 -2 Output: -* Test Case 2 Input: 5
mca entrance sample papers - SQL
mca entrance sample papers  please send me sample papers of MCA entrance exam.. thanks in advance
java program
java program  Problem 1 Write a javaScript program that would input Employee Name, rate per hour, No. of hours worked and will compute the daily wage... worked plus OT pay Sample Output: Employee Name:__ Rate per hour:__ No.of
Java Program
and the number of cows and bulls for each word, your program should be able to work out.... Sample Test Cases Test Case 1 Input: 4 DBCC 0 2 CDAB 2 1 CAAD 1 2 CDDA 2 0 Output
Program error - WebSevices
Program error  Hello, Any one know the sample program for Login page using zend framework. Then how i connect my databse file to zend framework. Anyone help me
Sample Code For ArrayLlist - Java Beginners
Sample Code For ArrayLlist   Hi Friend, I want sample code for adding single records and multiple records using ArrayList.Give sample code for Arraylist with realtime application.  Hi I
need a Sample code - Development process
need a Sample code  i want run the python script in java code by using Runtime class and output should be formed like XML format.please help me. Advanced Thanks, Krishna
Sample JMS Project is NEEDED - JMS
Sample JMS Project is NEEDED  hi friends Priya here, currently i'm doing R & D on JMS to expertise in JMS. but i didn't get any Project specification or any projects on JMS... So plz tell me the urls of the JMS
word program - Java Beginners
ME THANK YOU!!Design a program to search a word for letters that the user...,so your program converts all letters by the user to the same case).You do... fasle is the default value when a Boolean array is initialized.If the program finds
Sample Code for DTO in WebApplication - Development process
Sample Code for DTO in WebApplication   Hi Friends, Can u explain DTO in webapplication with sample code
GPS Device Tracking Sample Web Application - Framework
GPS Device Tracking Sample Web Application  How and by what can i develop a sample web application which can track a GPS device? Kindly help in this context
sample e-commerce project desc& screens
sample e-commerce project desc& screens  Hi, I want Sample e-commerce project description and screens and registration, cataloge module...............plz send me
SCJP Module-12 Question-4
Given below the sample code : 1. double in= 314159.26; 2. NumberFormat nof = NumberFormat.getInstance(Locale.ITALIAN); 3. String str; 4. //insert code here Which code should be inserted at line 4 to set the value of b to 314.159,26
Iterator Java Sample
Java Sample Iterator interface makes the traversing of the elements easy...() Java Sample Iterator Example import java.util.ArrayList; import... sample { public static void main(String[] args) { List list = new ArrayList
SCJP Module-8 Question-10
Given a sample code: class Test extends Thread { public void run() { System.out.println("One"); System.out.println("Two"); } private void method() { System.out.println("Three"); } public static
java program to exchange soap message
and client side program in order to send the request. Any sample programs...java program to exchange soap message  Hi Friends, I want... a set of 15 parameters and program on web server side receives this 15 parameters
why the program is showing error?
why the program is showing error?  <%@page import="java.sql.*"%>...("sun.jdbc.odbc.JdbcOdbcDriver").newInstance(); conn = DriverManager.getConnection("jdbc:odbc:sample...; It is showing the error: An error occurred at line: 33 in the jsp file
SCJP Module-3 Question-2
Given a sample code: 1 public class Test { 2 public static void main(String[] args) { 3 OuterClass.InnerClass i = new OuterClass.new InnerClass(); 4 i.innerMethod(); 5 OuterClass o = new OuterClass(); 6 o.x=5; }} 7 class
SCJP Module-6 Question-28
Given below the sample code : class A1{ public void process() { System.out.print("Inside A1 "); }} class B extends A1{ public void process() throws IOException{ super.process(); System.out.print("Inside B "

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.