delete retailer jsp file (sir..is this a good logic.. jsp file is useful for what purpose)

Ads

 
 

Share on Google+Share on Google+

chandra
delete retailer jsp file (sir..is this a good logic.. jsp file is useful for what purpose)
1 Answer(s)      5 years and 3 months ago
Posted in : Java Beginners
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Internet Dreams</title>
<link rel="stylesheet" href="css/screen.css" type="text/css" media="screen" title="default" />

<link rel="stylesheet" media="all" type="text/css" href="c1ss/pro_dropline_ie.css" />
<script type="text/javascript">
function validateForm()
{

var x=document.form1.id.value;

if (x==null || x=="")
  {
  alert("Retailer Id cannot be empty");
  return false;
  }
/*var r=confirm("Untag the products?")
if(r==true)
{
confirm("Are you sure you want to delete retailer?")
}*/

}
</script>
</head>
<body>
<div id="page-heading"><h1>Delete Retailer</h1></div>

<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
<tr>
    <th rowspan="3" class="sized"><img src="images/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
    <th class="topleft"></th>
    <td id="tbl-border-top">&nbsp;</td>
    <th class="topright"></th>
    <th rowspan="3" class="sized"><img src="images/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
</tr>
<tr>
    <td id="tbl-border-left"></td>
    <td>
    <!--  start content-table-inner -->
    <div id="content-table-inner">

<form name="form1" action="RetController" onsubmit="return validateForm();">
    <table border="0" width="100%" cellpadding="0" cellspacing="0">
    <tr valign="top">
    <td>


        <!--  start step-holder
        <div id="step-holder">

            <div class="step-dark-left"><a href="">Registration Form</a></div>
            <div class="step-dark-right">&nbsp;</div>

        </div>
         end step-holder -->
    <br/>

        <!-- start id-form -->
        <table border="0" cellpadding="0" cellspacing="0"  id="id-form">
        <tr>
            <th valign="top">Enter Retailer Id:</th>
            <td><input type="text" name="id" id="id" class="inp-form" /></td>
            <td></td>
        </tr>
        </td>
        <td></td>
    </tr>

    <tr>
        <th>&nbsp;</th>
        <td valign="top">
            <input type="submit" name="submit" value="ret_id"  /></td>
        <td valign="top">   <input type="reset" value="" class="form-reset"  />
        </td>
        <td></td>
    </tr>
    </table>
</form>
    <!-- end id-form  -->

    </td>
    <td>
    </td>
    </tr>
</table>
</form>
</div>
</body>
</html>
Ads
View Answers

May 28, 2012 at 4:22 PM


The given code allow the user to enter any id, whose record is to be removed from database. This id is then send to action page to delete that particular record.

1)form.jsp:

< form method="post" name="form" action="delete.jsp" >

Enter Id: < input type="text" name="id">< br>

< input type="submit" value="Submit">

< /form>

2)delete.jsp:

<[email protected] import="java.sql.*"%>

<% String id=request.getParameter("id"); int no=Integer.parseInt(id); int sumcount=0; try { Class.forName("com.mysql.jdbc.Driver").newInstance(); Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root"); Statement st = conn.createStatement(); st.executeUpdate("DELETE FROM employee WHERE id = '"+no+"'"); response.sendRedirect("application.jsp"); } catch(Exception e){} %>


Ads









Related Tutorials/Questions & Answers:
delete retailer jsp file (sir..is this a good logic.. jsp file is useful for what purpose)
delete retailer jsp file (sir..is this a good logic.. jsp file is useful for what purpose)  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict... want to delete retailer?") }*/ } </script> </head> <body>
delete a file - JSP-Servlet
delete a file  Correct question::::How can we delete a file which is stored in a server when read write operations for this particular file is closed.  http://www.communigate.com/CommuniGatePro/WebFiles.html
Advertisements
delete a file - JSP-Servlet
delete a file  How can we read a file which is stored in a server when read write operations for this particular file is closed
Delete and edit data in xml file using JSP
Delete and edit data in xml file using JSP   I want to know how to delete and edit data from an XML file by use of JSP. I have XML file having tasks... in the xml file,I want to delete and edit some tasks using task id then how can i do
delete jsp
delete jsp  <%@ page language="java" contentType="text/html...; charset=ISO-8859-1"> <title>Delete Student</title> </head>...;/Controller"> <input type="hidden" name="page" value="delete"/> <
Java delete file if exists
Java delete file if exists  Hi, Hi how to delete file if exists? I need example code of java delete file if exists. Thanks   Hi, following code can be used: String tempFile = "C:/mydir/myfile.txt"; //Delete
JSP File
JSP File  Hi, What is JSP File? How to create JSP file? Thanks   Hi, JSP file is simple text file with .jsp extenstion. You can run JSP file on tomcat server. Read more at JSP tutorials section. Thanks
delete lines in the file
delete lines in the file   I am using a file as Input in program...The file contains round about 1,00,000 lines .My program after each iteration takes a data from that file at process it. My Question is when a particular data
delete lines in the file
delete lines in the file   I am using a file as Input in program...The file contains round about 1,00,000 lines .My program after each iteration takes a data from that file at process it. My Question is when a particular data
delete lines in the file
delete lines in the file   I am using a file as Input in program...The file contains round about 1,00,000 lines .My program after each iteration takes a data from that file at process it. My Question is when a particular data
Java file delete
Java file delete In this section, you will learn how to delete a file. Description of code Java makes file manipulation easier by providing many useful... we are going to delete a file. For this, we have created an object of File
jsp-file
jsp-file  i want to upload a file by browse button and the file should be save in ms access database.....how i can implement trough jsp plz help me sir
How to delete file in Java code?
How to delete file in Java code?  Hi, From my Java program I have to delete a file. How to delete file in Java code? Thanks   Hi, Java API provides methods for deleting a file in Java. You can use the delete
How to delete file in java ?
How to delete file in java ? In this section we will learn how to write a program to delete a file in java. You can delete the file or folder, java File class provide two methods: delete(path) : This method delete the file or throw
How to delete .xlsx file in java?
How to delete .xlsx file in java?  Hello Sir, I am unable to delete .xlsx file using below code, What is wrong here? if(myFile != null && myFile.exists()    && myFile.canRead() &&
java - file delete - Java Beginners
java - file delete  I will try to delete file from particular folder...){ try { File delete = new File (incurrentFile); System.out.println... following code to delete a file from the folder import java.io.File; public
view jsp file (reference file). is the way of coding good ?
view jsp file (reference file). is the way of coding good ?  <...="ISO-8859-1"%> View Retailer <%@ page import="com.tcs.ilp.*" %>...; <table border=2><tr><th>Retailer ID</th><th>
java - file delete - Java Beginners
java - file delete  I will try to delete file from particular folder...){ try { File delete = new File (incurrentFile); System.out.println... will try to delete these files. But it doesn?t delete from this folder. My code
J2ME delete file - Java Beginners
J2ME delete file  How do i delete a textfile on a mobile phone using j2me?  Hi Friend, Please visit the following link: http://www.roseindia.net/j2me/ Hope that it will be helpful for you. Thanks
parsing xml file in jsp
parsing xml file in jsp  example that pars XML file in JSP
jsp file - JSP-Servlet
jsp file  org.apache.jasper.JasperException: /jsp/admin/UserRegistration.jsp(155,4) According to the TLD or the tag file, attribute valu e... org.apache.jasper.JasperException: /jsp/admin/UserRegistration.jsp(155,4) According
C file delete example
C file delete example       This section illustrates you to delete a file in C. You can see in the given example that we want to remove the file HELLO.txt. For this, we have
jsp upload file to server
jsp upload file to server  How to create and upload file to server in JSP?   Find the given example that explains how to upload single and multiple file on server using JSP
written in jsp file
written in jsp file  how to create and write in a jsp file through simple core java code
Creating dynamic jsp file in java file to include another jsp file
Creating dynamic jsp file in java file to include another jsp file  I am able to create jsp file in java that includes ; table tr td and img tags..... Need to include jsp file in the same content. The below code doesn't help me
include a jsp file
include a jsp file   Sir, I have 2 jsp pages. I want to include second jsp in the first jsp page when a button in the first jsp is clicked. how can I do this. I tried in sevaral ways . I am using jsp and javascript... anyone
run jsp file
run jsp file  how to run the jsp file in varies web servers  .... The jsp file is to be saved into the web application folder.Let the file... For more information on JSP visit to : JSP Tutorials Thanks
file insertion - JSP-Servlet
file insertion  How to insert and retrieve .doc files into sql server with example using jsp and servlets
Sending File - JSP-Servlet
Sending File  How to use tag in Jsp, & How read a file fom Client  Hi Friend, We used tag to upload a file. Please visit the following links: http://www.roseindia.net/jsp/fileupload.shtml http
file size - JSP-Servlet
coding in the roseindia at the following url: http://www.roseindia.net/jsp/file_upload/Sinle_upload.xhtml.shtml. But, this jsp action file will not check.... http://www.roseindia.net/jsp/file_upload/employee_upload_profile_image.shtml
Delete a file from FTP Server
In this section you will learn how to delete file from FTP server using java