1

I'm working with iReport 5.6.0 to build some report templates. I'm having an issue when trying to retrieve some data from the DB. The DBMS is Informix and the procedure I'm doing is the following:

1. Add the Informix JDBC driver which I downloaded from Maven Central (com.ibm.informix:jdbc)

2. Create a datasource with the driver and the JDBC's URL. Test the connection and it's successful

3. In the Report query window I write a query and in the result pane (at the bottom) I get and error as you can see in the image below

iReport Report query

Am I missing something here? Where should I look? As I said the connection test to the DB is successful.

Thanks in advance for your answers.

Alvaro Pedraza
  • 1,176
  • 6
  • 20
  • 44
  • 1
    You probably need to specify the database name as part of the connection string. I think you've connected to the server, but the server manages a number of databases and you need to specify which one you're connecting to. You may need to add something like `:database=stores` to the connection string, after the `jdbc` part, in order to connect to the `stores` database — provide your own DB name there. You need to check the syntax; I haven't done much with JDBC at all, but there's a decent chance that this is closely related to your problem. – Jonathan Leffler May 04 '17 at 22:42
  • 1
    Informix [JDBC Manual — Connect to the database](https://www.ibm.com/support/knowledgecenter/SSGU8G_12.1.0/com.ibm.jdbc_pg.doc/ids_jdbc_032.htm). The manual as a whole should help; this section sounds appropriate. – Jonathan Leffler May 04 '17 at 22:45

1 Answers1

0

After doing a deep search in the Informix JDBC documentation I found this section where I found the correct syntax for the URL, which is

jdbc:informix-sqli://<host>:<port>/<dbName>:INFORMIXSERVER=<serverName>;user=<username>;password=<password>

Previously I was using the syntax shown in the screenshot below and providing credentials in the dialog instead of the URL.

Informix Connection Example in iReport

I don't know why the connection test was successful with the wrong syntax. Perhaps the test only pings the host and the port, without checking the connection parameters.

Hope this helps someone. Best regards.

PS: Thanks to user Jonathan Leffler, your comment helped me to find the solution

Community
  • 1
  • 1
Alvaro Pedraza
  • 1,176
  • 6
  • 20
  • 44