No query executer factory registered for the 'sql' language

Jaspersoft Community 'Read-Only' as of July 8, 2022

Transition to New TIBCO Community Just Weeks Away

You can still search, review wiki content, and review discussions in read-only mode. Please email with questions or issues requiring TIBCO review or response.


I have the following error When I try to fill my report before generation.

Exception in thread "main" net.sf.jasperreports.engine.JRRuntimeException: No query executer factory registered for the 'sql' language.
        at net.sf.jasperreports.engine.util.JRQueryExecuterUtils.getExecuterFactory(
        at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(
        at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(
        at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(
        at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(
        at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(
        at net.sf.jasperreports.engine.fill.JRFiller.fill(
        at net.sf.jasperreports.engine.JasperFillManager.fill(
        at net.sf.jasperreports.engine.JasperFillManager.fillReport(


This error appears when I try to create an executable jar of my project with Eclipse. When I simply run my class using eclipse, without passing through a JAR file, the report is generated with success.


Here is my code:

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.text.DateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.Map;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperExportManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.util.JRLoader;
public class ReportGenerator {
    private DateFormat sqlDateFormat = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    Connection conn;
    public void generateReport() {
        try {
            conn = DriverManager.getConnection(
                    "jdbc:mysql://localhost:3306/stats", "user", "pass");
            System.out.println("Loading Report Designs");
            //InputStream input = new FileInputStream(new File(
            //        "jasper/report2.jasper"));
            InputStream input = new FileInputStream(new File(
            JasperReport jasperReport = (JasperReport)JRLoader.loadObject(input);
            System.out.println("Creating JasperPrint Object");
            //Map<String, String> parameters = new HashMap<String, String>();
            //parameters.put("ReportTitle", "PDF JasperReport");
            Map<String, Object> parameters = new HashMap<String, Object>();
            // Filling title
            //parameters.put("ReportTitle", "PDF JasperReport");
            Calendar cStart = new GregorianCalendar();
            Calendar cEnd = new GregorianCalendar();
            cStart.add(Calendar.DAY_OF_MONTH, -7);
            // Filling parameters
            parameters.put(("sql_start_date"), sqlDateFormat.format(cStart.getTime()));
            parameters.put(("sql_end_date"), sqlDateFormat.format(cEnd.getTime()));
            JasperPrint jasperPrint = JasperFillManager.fillReport(
                    jasperReport, parameters, conn);
//            JasperPrint jasperPrint = JasperFillManager.fillReport(
//                    jasperReport, null, conn);
            // Exporting the report
            OutputStream output = new FileOutputStream(new File(
            JasperExportManager.exportReportToPdfStream(jasperPrint, output);
            System.out.println("Report Generation Complete");
        } catch (FileNotFoundException e) {
        } catch (JRException e) {
        } catch (ClassNotFoundException e) {
        } catch (SQLException e) {
    public static void main(String[] args) {
        new ReportGenerator().generateReport();

For information, I use Jasper Reports v5.1.2

Can someone help me ?? I'm stuck with this issue... Thank you in advance !

mathieu.kergosien's picture
Joined: Jun 18 2013 - 3:28am
Last seen: 8 years 11 months ago

0 Answers:

No answers yet