Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

HOWTO: Use the Spring data access methods together with the WebRowSet class

843859Jan 3 2008 — edited Jan 4 2008
With 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 1 2008
Added on Jan 3 2008
3 comments
411 views