try {
st = db.prepare( sql );
rs = st.executeQuery();
Renderer renderer = null;
// xml
if ( format.equals(Format.XML) ) {
final TXmlResultSet tpl = new TXmlResultSet();
tpl.setResultSet( rs );
renderer = tpl.makeRenderer();
}
// csv
else if ( format.equals(Format.CSV) ) {
final TCsvResultSet tpl = new TCsvResultSet();
tpl.setResultSet( rs );
renderer = tpl.makeRenderer();
}
// json
else if ( format.equals(Format.JSON) ) {
final TResultSet tpl = new TResultSet();
tpl.setResultSet( rs );
renderer = tpl.makeRenderer();
}
if ( renderer != null )
return renderer.asString();
}
catch ( final Exception e ) {
log.debug( e );