November 2005
Intermediate to advanced
304 pages
6h 14m
English
In Java 5 and higher, there is a very convenient way to get data out of a database and into an XML document. This new addition to the JDBC family is called WebRowSet. It's an interface in the javax.sql.rowset package
, and the core API has an implementation called WebRowSetImpl. With this class, you can easily convert a database query's ResultSet into an XML representation. From a JDBC result set, you can populate a WebRowSet by using the following:
import com.sun.rowset.WebRowSetImpl; ResultSet rs = statement.executeQuery("select * from MyTable"); WebRowSetImpl data = new WebRowSetImpl(); ...Read now
Unlock full access