Jump to content
We've recently updated our Privacy Statement, available here ×

Retrieving data from InfluxDB using the custom JDBC driver


sadi.el-assadi

Recommended Posts

Hi all,

we need to fetch the data for our reports from InfluxDB. Users are supposed to create their own report templates and write the InfluxDB queries themselves. Since InfluxDB query language is very similar to SQL, we thought of developing a JDBC driver for InfluxDB and use it to generate reports both from Jasper studio and programatically using Jasper library. 

So basically I have 2 questions:

  1. When generating reports programatically, we will be passing java.sql.Connectiion (conn) as an argument, when executing report like this:
    JasperPrint jasperPrint = JasperFillManager.fillReport(reportTemplate, parameters, conn);

    In that case the SQL query defined in the report template will no longer be executed on the JDBC Data Adapter defined in the report template, but on the provided connection instead. When we were testing this with Postgres JDBC driver, that's how things worked. But I'm wondering, is there anything else besides implementing InfluxDB JDBC driver, we need to do, in order for report template to use the provided DB connection instead of data adapter, to execute the SQL queries? I couldn't find any documentation on this, and since Jasper library handles all of this under the hood, it's not that obvious if and what else needs to be done.

  2. Is the approach described above OK? I would hate to realize we are reinventing the wheel after we've already spent significant amount of time on the implementation.

Thanks,

Sadi

Link to comment
Share on other sites

  • 2 months later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hey Sadi, did you get the driver to work? I am currently struggling to find a driver for InfluxDB. I think there is only one on Github, but I do not know how to use ist correctly, since Jasper wants .jar files and the Github Repo only consists of .java files.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...