Package org.apache.commons.dbutils

Examples of org.apache.commons.dbutils.QueryRunner.query()


        "FROM report " +
            "LEFT JOIN report_observation ON (report.id=report_observation.reportId) " +
            "LEFT JOIN report_error ON (report_observation.errorId=report_error.id) ";

        QueryRunner runner = new QueryRunner(Application.getDB().getDataSource());
        return runner.query(sql, new JoinedReportHandler());
    }

    public static Report getReport(int reportId) throws SQLException
    {
        String sql = "SELECT "+
View Full Code Here


            "LEFT JOIN report_error ON (report_observation.errorId=report_error.id) " +
        "WHERE report.id = ?";

        try {
            QueryRunner runner = new QueryRunner(Application.getDB().getDataSource());
            return runner.query(sql, new JoinedReportHandler(), reportId).get(0);
        }
        catch (IndexOutOfBoundsException e) {
            return null;
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.