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//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>
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:

<%@page 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){} %>









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"/> <
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
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
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
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
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>
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
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
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() &&
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
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
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
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
written in jsp file
written in jsp file  how to create and write in a jsp file through simple core java code
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
parsing xml file in jsp
parsing xml file in jsp  example that pars XML file in JSP
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
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
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 insertion - JSP-Servlet
file insertion  How to insert and retrieve .doc files into sql server with example using jsp and servlets
run jsp file
run jsp file  how to run the jsp file in varies web servers  ... the class path also. The jsp file is to be saved into the web application folder.Let the file be 'abc.jsp' and web application folder be 'examples'. Start the tomcat
JSP file download - JSP-Servlet
JSP file download  Hi! I am saving (webapp/docs/sample.docx) path of the word file in database. when i want to download that file i am eliminating that file path using path.subString(16).. upto docs/. when i am clicking
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
Generated java file - JSP-Servlet
org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 7 in the generated java file Syntax error on token ";", delete this token...Generated java file  Hello friends, At run time JSP
pdf file in jsp
pdf file in jsp  i have a pdf, which has to be displayed in a jsp page along with some html tags, the pdf which is to be displayed shold be readonly and wont allow the uer to save too
insert , edit , and delete button in one jsp page
insert , edit , and delete button in one jsp page  hello I want to ask about the way of creating a jsp page contains insert , edit , and delete buttons and manipulate data in database directly. any help please or hints
File uploading - JSP-Servlet
. http://www.roseindia.net/jsp/file_upload/Sinle_upload.xhtml.shtml...File uploading  i am using file uploading code for multiple file and aslo for single file but i am getting problem that No such file found
External file reading in jsp
External file reading in jsp  i have written a jsp page(ReadExt.jsp) in my application which reads a text file content from a system... used java code in jsp page ... and tel me how can i make it work in other system
pasing variables in jsp file - JSP-Servlet
files share variables and how can one pass local variables from one jsp file to another jsp file?  Hi Friend, To pass variables from JSP file to another JSP file ,do the following: 1) create jsp page 'passVariable.jsp'and use
file uploading - JSP-Servlet
file uploading  Hi, thanks a lot for your kind answer. Now my program... problem. Im not geeting the full output for the program. Even, the file... to solve the problem as well. Thanks in advance. Input File
External file reading in jsp
External file reading in jsp  i have written a jsp page(ReadExt.jsp) in my application which reads a text file content from a system...; The given code reads the given file. It uses BufferedReader class to read
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
File upload - JSP-Servlet
File upload  Hello Friends, In my JSP project i want to do a file upload part. For this, i designed two files one for input and other... File Uload Using JSP   Choose the file To Upload
JSP Include File
JSP Include File          JSP Include File is used to insert a html file and the text file in the jsp page when the JSP page is compiled. The insert
File upload - JSP-Servlet
File upload  I am trying to do a file upload program. But, it shows... that. 1.Input file sending program ----------------------------------------------------------------------------- Display file upload form to the user <
file upload using JSP
file upload using JSP  I have created a form to upload a file in a html page, now i want to get the path of the file in a jsp page so what code...="java" %> <HTML> <HEAD><TITLE>Display file upload form
Searching a word file on server in JSP - JSP-Servlet
Searching a word file on server in JSP  Seacrhing a word file on server side using JSP. I am Apache Tomcat Server. Please help me Sir
jsp:include page=.. and include file = ...
jsp:include page=.. and include file = ...   What is the difference between <jsp:include page = ... > and <%@ include file = ... >... from one jsp file required to include in multiple jsp files.ADS_TO_REPLACE_1
Error in loading jsp file - JSP-Servlet
Error in loading jsp file  I did as u have said. I copied iitem.jsp in webapps\examples\jsp and item.java in webapps\examples\WEB-INF\classes\form. I ran the jsp file by typing the following address in the address bar: http
File Upload And download JSP Urgent - JSP-Servlet
File Upload And download JSP Urgent  Respected Sir/Madam, I... Ragavendran, i am sending code of file download in jsp. Plz implement this code. file download in jsp
write xml file with jsp useBean - JSP-Servlet
write xml file with jsp useBean  how to write into xml files with jsp... in advance...  Hi friend, The logic of the program is written inside... an org.w3c.dom.Document from XML. Save the xml file at bin file of C:\apache-tomat-5.5.23\bin
Add a jsp file to java application
Add a jsp file to java application  How to add a JSP file to java...;%@include file="success.jsp" %><br/> <h2>Here You are including a Jsp... the contents of the named file into the JSP containing the tag.You can say
Image upload file - JSP-Servlet
://www.roseindia.net/jsp/file_upload/employee_upload_profile_image.shtml http://www.roseindia.net/jsp/file_upload/Sinle_upload.xhtml.shtml Thanks...Image upload file  I want a code for image upload jsp or servlet

Ads