delete multiple row using checkbox

delete multiple row using checkbox

delete multiple row using checkbox

View Answers

April 7, 2017 at 11:49 AM

thank you for help


April 7, 2017 at 1:54 PM

how to delete any checkbox selected value? but this program are not satisfied the condition....i will increase string size then delete file...actually don't know how many data are store data in database...plz help me


March 27, 2012 at 10:17 AM

We are providing you the code where we have specified only three fields bookid,author and title in the database.

1) Create book.jsp

<%@page import="java.sql.*"%>

<form name=myname method=post action="delete.jsp">
<table border="1">
<tr><td></td>
<td><b><u>bookid</u></b></td>
<td><b><u>Author</u></b></td>
<td><b><u>title</u></b></td>
</tr>
<%try{

Connection conn = null;
Class.forName("com.mysql.jdbc.Driver").newInstance();
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/mysql","root", "root");
ResultSet rs = null;
Statement st=null;
st=conn.createStatement();
rs = st.executeQuery("select * from book");
int i=0; while(rs.next()){ %>
<tr><td><input type="checkbox" name="check<%=i%>" value=<%= rs.getString("bookid") %>></td>
<td><%= rs.getString("bookid") %></td>
<td><%= rs.getString("author") %></td>
<td><%= rs.getString("title") %></td>
</tr><%
i++;
}
}catch(SQLException e){ System.out.println(e.getMessage()); } %>
</table>
<input type="submit">
</form>

2) Create delete.jsp

<%@page import="java.sql.*"%>

<%String id[]= new String[10];
for(int i=0;i<10;i++){
id[i]=request.getParameter("check"+i);
out.println(id[i]);
}
%>
<%try{
Connection conn = null;
Class.forName("com.mysql.jdbc.Driver").newInstance();
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/mysql","root", "root");
ResultSet rs = null;
Statement st=null;
st=conn.createStatement();
for(int a=0;a<10;a++){
st.executeUpdate("delete from book where bookid='"+id[a]+"'");

}
}catch(SQLException e){ 
    System.out.println(e.getMessage()); 
    }
    %>









Related Tutorials/Questions & Answers:
delete multiple row using checkbox
delete multiple row using checkbox  how to delete multiple row in a table which is connected to database using checkbox
delete multiple row using checkbox
delete multiple row using checkbox  how to delete multiple row in a table which is connected to database using checkbox
Advertisements
delete multiple row using checkbox
delete multiple row using checkbox  delete multiple row using checkbox   We are providing you the code where we have specified only three... i=0; while(rs.next()){ %> <tr><td><input type="checkbox" name
delete row using id
delete row using id  package pkg2; import org.hibernate.Query; import... = "delete from Insurance insurance where id = 2"; Query query = sess.createQuery(hql); int row = query.executeUpdate(); if (row == 0
how to delete a row in sql without using delete command.
how to delete a row in sql without using delete command.  how to delete a row in sql without using delete command. thanks in advance
Adding checkbox in table using that delete table rows
Adding checkbox in table using that delete table rows  I need coding for how to add checkbox in table,the table data from database.Using that checkbox select more than than one rows,and using delete button i want to delete
delete row from a table using hibernate
delete row from a table using hibernate  //code in java file String hql="delete from CONTACT c where ID=6"; Query query=session.createQuery... [delete from CONTACT] int i=query.executeUpdate
How to delete the row from the Database by using servlet
How to delete the row from the Database by using servlet  Dear Sir/Madam I am trying to delete the one user data in the Oracle SQL server database...: Delete row from database using servlet   In that link solution
delete row
delete row  how to delete row using checkbox and button in php... if(isset($_POST['delete'])) { for($i=0;$i<$row;$i++) { $delete = $checkbox[$i]; mysql_query("delete from sonu where id='$delete
How to delete the row from the Database by using while loop in servlet
How to delete the row from the Database by using while loop in servlet  Dear Sir/Madam, I am trying to delete the one user data in the Oracle SQL server database by using Servlet program (Tomcat server). In Database table
delete row from a table in hibernate
delete row from a table in hibernate  is there method to delete row in a table using hibernate like save(-) to insert row
insert and delete a row programmatically
insert and delete a row programmatically  How to insert and delete a row programmatically ? (new feature in JDBC 2.0
sqlite database delete row
sqlite database delete row  How to delete row from SQLite Database?    NSString *updateSQL = [NSString stringWithFormat: @"DELETE FROM aListDB WHERE id='%@'",details.ids
php delete checkbox
php delete checkbox  How can i delete the data with multiple check boxes in PHP
JDBC: Delete Record using Prepared Statement
how to delete row of a table using Prepared Statements. Delete Record ... Clause. So you can delete one row or multiple row of table as specified... : Delete Record using PreparedStatement... Row deleted successfully
uitableview manually delete row
uitableview manually delete row  uitableview manually delete row   NSMutableIndexSet *indexes = [NSMutableIndexSet indexSet]; [array removeObjectAtIndex:indexPath.row]; if(![array count]) [indexes addIndex
Delete a row from database by id
Delete a row from database by id  I m creating a small application using servlet. There is a form (index.jsp)having 10 fields on submitting the form...) for "DELETE" AND "UPDATE". On clicking delete which is hyper link that particular row
how to insert multiple columns of a single row into my sql database using jsp
how to insert multiple columns of a single row into my sql database using jsp  hi sir, how to insert multiple columns of a single row into my sql database using jsp. when i click ADD ROW,rows are added.when i click submit
JDBC ResultSet Delete Row Example
JDBC ResultSet Delete Row Example: Learn how to delete row using ResultSet. We are also used ResultSet object with update capability for delete rows from... for delete the current row form the table of the ResultSet object. Example
Hibernate delete a row error - Hibernate
Hibernate delete a row error  Hello, I been try with the hibernate delete example (http://www.roseindia.net/hibernate/hibernate-delete.shtml...(); //======================================= sess = fact.openSession(); String hql = "delete from Contact contact
data grid with edit and delete options at each row.
data grid with edit and delete options at each row.  i want to display the table data in the format of data grid with edit and delete options at each row. i need it very urgently. advance thanks
delete an entry using JavaScript
delete an entry using JavaScript  How to delete an entry using JavaScript
Delete multiple records with pagination by selecting checkboxes
Delete multiple records with pagination by selecting checkboxes  Hi there,I'm working with PHP.I want to delete my database records which is displayed using pagination by selecting check boxes.But I'm able to delete only records
Insertion of multiple row data for billing purpose.
Insertion of multiple row data for billing purpose.  Hi , I have...)========(inutfield2) I want to insert all these row value .problem is that the no of text field in row/column can be dynamic. so how can i insert all
checkbox
checkbox  how to insert multiple values in database by using checkbox in jsp
Delete Query using HQL
Delete Query using HQL  Can we write 'AND' with 'WHERE' clause in delete query using HQL? For example: delete from table name where field1... is "delete from table where field1 = 'value1' and field2 = 'value2'.   Have
add row in grid using dojo
add row in grid using dojo  add row in grid using dojo
Update delete perticular row from brower on link - Struts
Update delete perticular row from brower on link   how can update and delete perticular row from List of employee in brower format are ramesh... delete when i click on update than that perticular row are display on another
JDBC Delete Row In Table Example
JDBC Delete Row In Table Example : In this tutorial we will learn how delete... or more specific  row delete from table that follow any given condition...; delete row then count deleted row and display output "Deleted specific
jQuery Multiple Checkbox Select / Deselect
"); } }); }); jQuery Multiple Checkbox Select / Deselect In this section, you will learn how to create multiple checkbox group which select/deselect the group...;Multiple Checkbox Select/Deselect - DEMO</TITLE> <SCRIPT language="
Using criteria for multiple tables
Using criteria for multiple tables  How to join more than three tables,those tables must be maintain primary key relation ship using Hql criteria & projections
Using criteria for multiple tables
Using criteria for multiple tables  How to join more than three tables,those tables must be maintain primary key relation ship using Hql criteria & projections
deleting messages using checkbox in JSP
deleting messages using checkbox in JSP  Am working on a Mail Server... is deleting correctly in my project. But Problem occurs when i use to delete... on button it shows an error. A when there is no message in it and i click on delete its
deleting messages using checkbox in JSP
deleting messages using checkbox in JSP  Am working on a Mail Server... is deleting correctly in my project. But Problem occurs when i use to delete... on button it shows an error. A when there is no message in it and i click on delete its
multiple JComboBoxes using with JDBC
multiple JComboBoxes using with JDBC  how to use JComboBoxes with JDBC in java  Hi Friend,Try the following code:import java.awt.*;import java.sql.*;import javax.swing.*;public class MultipleJCombo{public MultipleJCombo
insert data in the database using checkbox
insert data in the database using checkbox  i am fetching data from the database using servlet on the jsp page and there is checkbox corresponding each row but the problem is that i am not fetching data in any textboxes so how
How to delete objects using Hibernate?
How to delete objects using Hibernate?  Hi, How to delete objects using Hibernate? I want to delete an object (record) in table. Thanks   Hi, Hibernate Session API provides function to delete object. For deleting
Write a query to display a row using index
Write a query to display a row using index  Write a query to display a row using index
Shifting Row Using JSP
Shifting row using JSP       In this program we are going to shift the row using java... up. The starting row is 5 and end row is 10 and which will be shifted up 5 rows
display multiple image file or pdf file in multiple column of a row from server or database
display multiple image file or pdf file in multiple column of a row from server... in a particular format i.e I have to display more than one files in multiple columns in a single row..Suppose I have to display two files in a row then after
insert checkbox in cell using POI api in java
insert checkbox in cell using POI api in java  I need to insert checkbox in excel cell using POI and java. Any one help me on this. Ashok S
Delete and add row from Table View iPhone
Delete and add row from Table View iPhone In this tutorial will learn how to delete and also how to add row into the table view iPhone, with the help of edit... and Delete buttons on Table view. Table views are commonly found in iPhone applications
Email to multiple recipients using jsp
Email to multiple recipients using jsp  Hi sir, Am a doing a project,in that i need to send email to multiple user at a time,the to address should enter manually its not not be written in code using jsp. Regards, Santhosh
Email to multiple recipients using jsp
Email to multiple recipients using jsp  Hi sir, Am a doing a project,in that i need to send email to multiple user at a time,the to address should enter manually its not not be written in code using jsp. Regards, Santhosh
include a delete option in every row of table in a JSP page
include a delete option in every row of table in a JSP page  I have the following code of a JSP page........... <blockquote> <p>... on Delete it should delete the particular record from the database and reflect
SQL Server row comparison using two tables
SQL Server row comparison using two tables  insertion process are completed in table1.string comparison using table2 to table1 if any changes in these tables and then upadated
I want to update the multiple values of database depending on checkbox..? Please help me out..
I want to update the multiple values of database depending on checkbox..? Please help me out..   Hi .. I want to Update the multiple values of database using checkboxes and want to set the session for selected checkboxes
Using insert update and delete in the same servlet
Using insert update and delete in the same servlet  How to write insert, update and delete coding in the same servlet
Displaying the entire row in another datatable when the checkbox is checked - Java Server Faces Questions
Displaying the entire row in another datatable when the checkbox... to fetch a row completely when the check box corresponding to that row is checked. In the backing bean an object corresponding to a row is created. How can i display
Delete row and column from table through java code
Delete row and column from table through java code... will see how to delete row and column from given table through java code. Java code... | +----+----------+------------+---------+ In this table we will delete the row having minimum value of ID then delete

Ads