/** * Creates the data source from a connection. * * @return the data source to be used * @throws JRException */ private JRDataSource createQueryDatasource() throws JRException { if (query == null) { return null; } try { if (log.isDebugEnabled()) { log.debug( "Fill " + filler.fillerId + ": Creating " + query.getLanguage() + " query executer"); } JRQueryExecuterFactory queryExecuterFactory = JRQueryExecuterUtils.getQueryExecuterFactory(query.getLanguage()); queryExecuter = queryExecuterFactory.createQueryExecuter(parent, parametersMap); filler.fillContext.setRunningQueryExecuter(queryExecuter); return queryExecuter.createDatasource(); } finally { filler.fillContext.clearRunningQueryExecuter(); } }
public JRQueryExecuter createQueryExecuter(JRDataset jRDataset, Map map) throws JRException { JRQuery query = jRDataset.getQuery(); String queryString = query.getText(); return new CSVQueryExecuter(queryString); }