HttpServletRequest request,
HttpServletResponse response)
throws Exception
{
DbManager dbManager;
QueryBuilder builder;
RunnableQuery query;
Connection conn;
AnyActionForm frm;
DataSource ds;
String queryName;
String redirect;
frm = (AnyActionForm)form;
queryName = frm.getString("queryname");
if (queryName == null) throw new Exception("Query not specified, please check your html form");
redirect = frm.getString("redirect");
if (redirect == null) throw new Exception("Redirect not specified, please check your html form");
if (isQueryable(frm))
{
dbManager = DbBaseAction.getDbManager();
if (dbManager == null) throw new Exception("DbManager not configured!");
ds = DbBaseAction.getDatasource();
if (ds == null) throw new Exception("Datasource not configured!");
conn = ds.getConnection();
try
{
builder = new QueryBuilder(conn, dbManager);
query = builder.getQueryStatement(queryName, getStatementName(frm));
try
{
execute(frm, request, response, query);
}