dcsimg
Editable table on JSP page
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   William_Blencowe
Posted On:   Monday, March 1, 2004 06:56 AM

I'm looking for the simplest/quickest way to present a DB table on a JSP that's editable(represents the resultset) and then can be used to update the database. I'm thinking it would look like a Excel spreadsheet(rows/columns) that the user could double click a cell, update it(or other) and then submit the page to update the db. I've looked at the JSTL sql tablibs, but it appears that they only present the data and can't be used to update from the query resultset. -bill

Re: Editable table on JSP page

Posted By:   Anjan_Bacchu  
Posted On:   Monday, March 1, 2004 07:24 AM

Hi There,



I beleive that using a Rowset interface might help you. Not sure if there is a JSTL tag for it.

Here's the Java Docs



The RowSet interface is unique in that it is intended to be implemented using the rest of the JDBC API. In other words, a RowSet implementation is a layer of software that executes "on top" of a JDBC driver. Implementations of the RowSet interface can be provided by anyone, including JDBC driver vendors who want to provide a RowSet implementation as part of their JDBC products.



A RowSet object may make a connection with a data source and maintain that connection throughout its life cycle, in which case it is called a connected rowset. A rowset may also make a connection with a data source, get data from it, and then close the connection. Such a rowset is called a disconnected rowset. A disconnected rowset may make changes to its data while it is disconnected and then send the changes back to the original source of the data, but it must reestablish a connection to do so.



A disconnected rowset may have a reader (a RowSetReader object) and a writer (a RowSetWriter object) associated with it. The reader may be implemented in many different ways to populate a rowset with data, including getting data from a non-relational data source. The writer can also be implemented in many different ways to propagate changes made to the rowset's data back to the underlying data source.



Rowsets are easy to use. The RowSet interface extends the standard java.sql.ResultSet interface. The RowSetMetaData interface extends the java.sql.ResultSetMetaData interface. Thus, developers familiar with the JDBC API will have to learn a minimal number of new APIs to use rowsets. In addition, third-party software tools that work with JDBC ResultSet objects will also easily be made to work with rowsets.



BR,

~a
About | Sitemap | Contact