Take a JDBC ResultSet and stream it in one of the supported formats
...You can as well zip the stream and send it over the network, if you want. DataSink currently implements the following table formats: DBF (the xBase file format), XHTML, and genericode. You can use it as an Ant task or directly from Java.
Peruser is a open-source lightweight knowledge application framework. Peruser speaks XML and RDF and is implemented in Java. Peruser code runs within Cocoon, as a standalone webapp, as console programs invoked through ant, or as embeddable java code.
Middlegen is a free general-purpose database-driven code generation engine based on JDBC, Velocity, Ant and XDoclet. If you already have a database, you can use Middlegen to generate EJB (CMP 2.0), Hibernate, JDO and JSP/Struts source code.