editing cell in a table

editing cell in a table

View Answers

July 1, 2009 at 1:24 PM

Hi Friend,

Try the following code:

1)updateDatabase.jsp

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

<form name=myname method=post action="update.jsp">
<table border="1">
<tr>
<td><b><u>RollNo</u></b></td>
<td><b><u>Name</u></b></td>
<td><b><u>Class</u></b></td>
</tr>
<%try{

Connection conn = null;
Class.forName("com.mysql.jdbc.Driver").newInstance();
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root";, "root");
ResultSet rs = null;
Statement st=null;
st=conn.createStatement();
rs = st.executeQuery("select * from employee where emp_id='2'");
while(rs.next()){ %>
<tr>
<td><input type="text" name="eid" value="<%= rs.getString("emp_id") %>"></td>
<td><input type="text" name="ename" value="<%= rs.getString("empName") %>"></td>
<td><input type="text" name="eadd" value="<%= rs.getString("empAddress") %>"></td>
</tr>
<%}
}
catch(SQLException e){}
%>
</table>
<input type="Submit">

2) update.jsp
<%@page import="java.sql.*"%>
<% String id=request.getParameter("eid");
String name=request.getParameter("ename");
String address=request.getParameter("eadd");
try{
Connection conn = null;
Class.forName("com.mysql.jdbc.Driver").newInstance();
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root";, "root");

Statement st=null;
st=conn.createStatement();
st.executeUpdate("update employee set empName='"+name+"', empAddress='"+address+"' where emp_id='"+id+"'");
out.println("Data is updated successfully.");
}
catch(Exception e){}
%>

Thanks









Related Tutorials/Questions & Answers:
editing cell in a table - JDBC
editing cell in a table  how can i edit a cell in a table and save the change to a database  Hi Friend, Try the following code: 1)updateDatabase.jsp RollNo Name Class "> "> ">
how to allow table editing
how to allow table editing   1**. hi... l've tried the method isCellEditable(int rowIndex, int colIndex) { return true but it doesn't enabled the user the editing of any cell why????????????? regards
Advertisements
Height for cell in table view - UITableView
Height for cell in table view - UITableView  UITableview height for cell What is the height for cell in table view iPhone mobile application
css table cell margin
css table cell margin  How can i put margin between two columns(cell margin)?   In your CSS you can set the desired margin between two cells as given below.. padding-right:10px;   now you need to call
image on div or cell of table
image on div or cell of table  I am using ms access database and I... but it display on browser but I want to display on inside the div tag or table tag pls... is to display on div or table... thnx in advance
image on div or cell of table
image on div or cell of table  I am using ms access database and I... but it display on browser but I want to display on inside the div tag or table tag pls... is to display on div or table... thnx in advance
image on div or cell of table
image on div or cell of table  I am using ms access database and I... but it display on browser but I want to display on inside the div tag or table tag pls... is to display on div or table... thnx in advance
image on div or cell of table
image on div or cell of table  I am using ms access database and I... but it display on browser but I want to display on inside the div tag or table tag pls... is to display on div or table... thnx in advance
image on div or cell of table
image on div or cell of table  I am using ms access database and I... but it display on browser but I want to display on inside the div tag or table tag pls... is to display on div or table... thnx in advance
image on div or cell of table
image on div or cell of table  I am using ms access database and I... but it display on browser but I want to display on inside the div tag or table tag pls... is to display on div or table... thnx in advance
Table Empty Cell in HTML
Table Empty Cell in HTML       The Table Empty Cell in HTML define no content inside a cell of table. The code is not able to display border around the empty cell in a table
ModuleNotFoundError: No module named 'table_string_sqlite_cell'
ModuleNotFoundError: No module named 'table_string_sqlite_cell'  Hi...: No module named 'table_string_sqlite_cell' How to remove the ModuleNotFoundError: No module named 'table_string_sqlite_cell' error? Thanks  
ModuleNotFoundError: No module named 'table_string_sqlite_cell'
ModuleNotFoundError: No module named 'table_string_sqlite_cell'  Hi...: No module named 'table_string_sqlite_cell' How to remove the ModuleNotFoundError: No module named 'table_string_sqlite_cell' error? Thanks  
Query on Java Swing - Table Cell Issue - Swing AWT
Query on Java Swing - Table Cell Issue  Hi, I have a query on Java... the key board focus is moving from one cell to another table cell but I am unable to show the cursor in the focused cell which is editable. what do I need do
Editing the Profile
Editing the Profile  how to populate drop-down menu instead of text box in editing the profile
differences between cell spacing and cell padding
differences between cell spacing and cell padding  What are the differences between cell spacing and cell padding
restrict jtable editing
restrict jtable editing  How to restrict jtable from editing or JTable disable editing?   public class MyTableModel extends AbstractTableModel { public boolean isCellEditable(int row, int column
change content of cell javascript
change content of cell javascript  change content of cell javascript
ModuleNotFoundError: No module named 'mass_editing'
ModuleNotFoundError: No module named 'mass_editing'  Hi, My Python... 'mass_editing' How to remove the ModuleNotFoundError: No module named 'mass_editing' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'media_editing'
ModuleNotFoundError: No module named 'media_editing'  Hi, My... 'media_editing' How to remove the ModuleNotFoundError: No module named 'media_editing' error? Thanks   Hi, In your python
Display of value in Tabel cell
in the table cell by defining the cell editor.The cell is having a text field and calendar.When i select a date in the calendar the date will be displayed in the cell...) The format the cell is showing when its in focus - Mon,dd,yyyy(Mar,01,2011). I
Auto select cell on mouse hover using 'hover' mouse event
Auto select cell on mouse hover using 'hover' mouse event In this tutorial, we will discuss about how to highlight Table's cell on mouse hover using jQuery 'hover' mouse event. In this example, a table is given
Custom Cell View UITableview
Custom Cell View UITableview  How can i get two custom cell view in UITableView
Subtitle in Table View  iPhone
cell of the Table view and index to Table view. As explain about the Table view... using the same concept will add the object into the cell of Table View and added... to the cell of Table View. After that will set the frame of the cell and also
ModuleNotFoundError: No module named 'cell'
ModuleNotFoundError: No module named 'cell'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'cell' How to remove the ModuleNotFoundError: No module named 'cell' error
JSP:HTML Form in-place Editing - JSP-Servlet
developer's needs. This is a follow up to the HTML Form in-place editing. The code... an excellent way of editing a form. I just have a few adjustments if any of you could... to be able to open a page instead of a window for the editing which opens
table
table  multiplicatyion table
TABLE
TABLE   Why doesn't <TABLE WIDTH="100%"> use the full browser width
Table
Table  How i generate table in showMessageDialog. I want that i creat a table and run in showMessageDialogeprint("cprint("code sample");ode sample
Table
Table  How I generate table in showMessageDialog. E.g 3X1=3 3X2=6 3X3=9print("code sample
Table
Table  How i generate table in showMessageDialog. I want to creat a table and run in showMessageDialoge. Pl make a table programe which run..., JOptionpane, Integer.parseInt. Please use only these above methods to make table
table
input from oracle table(my database table..) This is a very important table of my
table
table  Hi..I have a list of links which links to a table in the same page.If I click first link the table is displayed at the top, likewise if i click the last link the table is displayed at the last,i dont know how to set
Table
Table  How i generate table in JOptionpane.showMessageDialog... advance coding but i want u make the table using JOptionpane.showMessageDialog, import.javax.swing int Integer.parseInt(). Thats my limit. Pl generata a table
table?
table?  Hi, how could i make a table in javascript, which would look like this: AA CODON Number /1000 Fraction .. (this row... can't figure out, how to construct a table,with two fixed columns, one that reads
ModuleNotFoundError: No module named 'odoo11-addon-mass-editing'
ModuleNotFoundError: No module named 'odoo11-addon-mass-editing'  Hi...: No module named 'odoo11-addon-mass-editing' How to remove the ModuleNotFoundError: No module named 'odoo11-addon-mass-editing' error? Thanks  
ModuleNotFoundError: No module named 'odoo12-addon-mass-editing'
ModuleNotFoundError: No module named 'odoo12-addon-mass-editing'  Hi...: No module named 'odoo12-addon-mass-editing' How to remove the ModuleNotFoundError: No module named 'odoo12-addon-mass-editing' error? Thanks  
ModuleNotFoundError: No module named 'odoo10-addon-mass-editing'
ModuleNotFoundError: No module named 'odoo10-addon-mass-editing'  Hi...: No module named 'odoo10-addon-mass-editing' How to remove the ModuleNotFoundError: No module named 'odoo10-addon-mass-editing' error? Thanks  
ModuleNotFoundError: No module named 'odoo11-addon-mass-editing'
ModuleNotFoundError: No module named 'odoo11-addon-mass-editing'  Hi...: No module named 'odoo11-addon-mass-editing' How to remove the ModuleNotFoundError: No module named 'odoo11-addon-mass-editing' error? Thanks  
ModuleNotFoundError: No module named 'odoo12-addon-mass-editing'
ModuleNotFoundError: No module named 'odoo12-addon-mass-editing'  Hi...: No module named 'odoo12-addon-mass-editing' How to remove the ModuleNotFoundError: No module named 'odoo12-addon-mass-editing' error? Thanks  
ModuleNotFoundError: No module named 'odoo13-addon-mass-editing'
ModuleNotFoundError: No module named 'odoo13-addon-mass-editing'  Hi...: No module named 'odoo13-addon-mass-editing' How to remove the ModuleNotFoundError: No module named 'odoo13-addon-mass-editing' error? Thanks  
ModuleNotFoundError: No module named 'odoo8-addon-mass-editing'
ModuleNotFoundError: No module named 'odoo8-addon-mass-editing'  Hi...: No module named 'odoo8-addon-mass-editing' How to remove the ModuleNotFoundError: No module named 'odoo8-addon-mass-editing' error? Thanks  
ModuleNotFoundError: No module named 'odoo9-addon-mass-editing'
ModuleNotFoundError: No module named 'odoo9-addon-mass-editing'  Hi...: No module named 'odoo9-addon-mass-editing' How to remove the ModuleNotFoundError: No module named 'odoo9-addon-mass-editing' error? Thanks  
Table
Table  Why u dont understand sir?? I want to make a table program which generate a table on showMessageDialog. I have learnt these methods until now... methods to be used. Write a table program which use only and only these above methods
Table
Table  How i create table on showMessageDialog using JOptionpane and Integer.parseInt. No other method to use. Pl make a program which generate 5X1=5 5X2=10 5X3=15   Hi Friend, Try this: import javax.swing.*; import
How to create a JTable cell containing Image hyperlink?
image (cell) in the last column of my table? so that, when the image link...How to create a JTable cell containing Image hyperlink?  I'm trying to find out how to create a JTable cell which contains Image, which should
Setting Cell Values in JTable
Setting Cell Values in JTable       In this section, we will learn how to set the cell... about JTable. A cell is known as the format of  a row and a column in 
JTable - Cell selection - Swing AWT
JTable - Cell selection  How to select a cell of a JTable when I... javax.swing.event.*; public class JTableDemo extends JFrame { JTable table; DefaultTableModel tableModel; public JTableDemo() { table = new JTable(10, 5
Passing td cell id to servlet
Passing td cell id to servlet  Hi all, I am new to JSP/Servlet .Please help. I need to send the table cell index in servlet using javascript and should be able to make a cell index to have a text - "X" / "0"only once. Here
ModuleNotFoundError: No module named 'splitter-cell'
ModuleNotFoundError: No module named 'splitter-cell'  Hi, My... 'splitter-cell' How to remove the ModuleNotFoundError: No module named 'splitter-cell' error? Thanks   Hi, In your python

Ads