HOWTO: Use the Spring data access methods together with the WebRowSet class
843859Jan 3 2008 — edited Jan 4 2008With the WebRowSet class I can easily iterate over a ResultSet and produce some XML using the code below.
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection connection
= DriverManager.getConnection("");
Statement statement = connection.createStatement();
ResultSet resultSet = statement.executeQuery("SELECT SYSDATE FROM DUAL");
WebRowSet webRowSet = new WebRowSetImpl();
webRowSet.populate(resultSet);
statement.close();
connection.close();
webRowSet.writeXml(new FileOutputStream("C:\\SYSDATE.xml"));
So, how would I use the simplified Spring methods to do the same thing? The WebRowSet.populate method only supports a ResultSet object. The Spring framework only returns an SqlRowSet object that is not easily cast to the ResultSet, etc.
Thanks for your help.
Edited by: mrmeth0d on Jan 3, 2008 2:02 PM