Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners delete retailer jsp file (sir..is this a good logic.. jsp file is useful for what purpose)
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


chandra
delete retailer jsp file (sir..is this a good logic.. jsp file is useful for what purpose)
1 Answer(s)      2 years and 5 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>

Advertisement
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
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 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"/> <
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
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
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>
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
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
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
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
Delete a file from FTP Server
In this section you will learn how to delete file from FTP server using java
Delete a File
Enter the file name to delete:wonderful.txt File was successfully... Delete a File    ... a specified file or directory is deleted. For deleting a file from a directory you need
How to delete excel file records using Store Procedure?
How to delete excel file records using Store Procedure?  Hi.. I have created one Excel file through stored procedure.Now I want to delete records or delete excel file. Thanks
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
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
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
how to delete a jar file from mobile by using j2me program.
how to delete a jar file from mobile by using j2me program.  When i'll update a new version jar in mobile. Then i want to delete that old jar which is previously present in mobile. How to do
written in jsp file
written in jsp file  how to create and write in a jsp file through simple core java code
Delete image from folder - JSP-Servlet
+ photoname; System.out.println(path); new File(path).delete(); } } hope...Delete image from folder  Hi Thanks Rajnikant to given me... user id going to logout then at that time i need to delete image Pie(userid
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
How to delete content of a log file from linux terminal?
How to delete content of a log file from linux terminal?  Hi, My... running queries. But first I want to delete the content of the /var/log/slow-queries.log file. Can anyone tell me how to do this? Thanks   Hi, Its
Advertisements
 

 

 

DMCA.com