Search code examples
javajasper-reportsjaspersoft-studio

Where is information about the connection to DB located in Jasper markup?


In Jasper Studio 6.6.0, you can configure the connection to the database and start using the data from there. When I finished the report in the studio, I took the jrxml-file and then used it in the project to print pdf-reports.

Does the jrxml-markup store information about the connection to the database that was used in the studio?

P.S. I've not found such information inside jrxml. Well, now it's not clear: why connection to a DB is implemented in Jasper Studio and demonstration of filling the report with data from there?


Solution

  • As I found out later - the jrxml-markup only stores label that data should be taken from the database via connection. So when the function of forming the JasperPrint invoked you can pass the java.sql.Connection object as the last parameter:

    JasperFillManager.fillReport(JasperReport jReport, Map<String,Object> params, Connection connection)
    

    And the data will be received from the database.