iReport错误SQLException:数据库尚未选择 [英] iReport error SQLException: Database not selected yet

查看:177
本文介绍了iReport错误SQLException:数据库尚未选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用iReport 5.6.0构建一些报告模板.尝试从数据库检索某些数据时遇到问题. DBMS是Informix,我正在执行的过程如下:

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..添加我从Maven Central(com.ibm.informix:jdbc)下载的Informix JDBC驱动程序

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

2..使用驱动程序和JDBC的URL创建数据源.测试连接是否成功

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

3.报告查询窗口中,我编写了一个查询,在结果窗格(底部)中,我得到并出现错误,如下图所示.

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

我在这里错过了什么吗?我应该去哪里看?正如我所说的,与数据库的连接测试成功.

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

预先感谢您的回答.

推荐答案

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>

以前,我使用下面屏幕截图中显示的语法,并在对话框中提供凭据而不是URL.

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

我不知道为什么连接测试使用错误的语法会成功.也许该测试仅对主机和端口执行ping操作,而不检查连接参数.

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:感谢用户 Jonathan Leffler ,您的评论帮助我找到了解决方案

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

这篇关于iReport错误SQLException:数据库尚未选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆