在 BIRT 中,当我尝试从我的本地主机获取记录时,它工作正常。但是当我尝试使用远程连接时,出现如下指定的错误:
错误:
org.eclipse.birt.data.engine.odaconsumer.OdaDataException: Cannot get the result set metadata.
org.eclipse.birt.report.data.oda.jdbc.JDBCException: SQL statement does not return a ResultSet object.
SQL error #1:Table 'test.TBLUSERS' doesn't exist ... 63 more
Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'testbms.TBLUSERS' doesn't exist
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
注意:
Tablenames are automatically changing to capital letters, is that because of it. Because client server is linux and is it acting with case sensitive. But it displays column names but not the records. As soon as i click on finish, i get the error as specified in the below images.
引用图片:
如上图所示,它已经填充了第二行的表格列
他们是否需要为远程连接进行任何特殊配置,还是我做错了什么?
最佳答案
正如您所说,这可能是区分大小写的情况:
http://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html
Although database and table names are not case sensitive on some platforms, you should not refer to a given database or table using different cases within the same statement. The following statement would not work because it refers to a table both as my_table and as MY_TABLE:
mysql> SELECT * FROM my_table WHERE MY_TABLE.col=1;
如果您的开发箱不区分大小写,那么当您更改表名的大小写以匹配生产环境时,您仍然可以进行测试。在 MySQL 中也可能有一种使用系统表的方法。 (查看表是否存在的查询示例,请参见以下查询。):
SELECT count(*)
FROM information_schema.tables
WHERE table_schema = <schema-or-db-name>
AND table_name = <table-or-view-name>
但更实际的是,您的目标数据库应该通过一个变量传递给您的报告,您可以在数据集的脚本中检查该变量。将“this.query”值设置为等于基于该变量值的适当查询。
例如:
if ( params["source_db"].value == "Server=myProductionAddress;Database=myProductionDB;Uid=myUsername;Pwd=myPassword;" )
{
this.query = "SELECT .... prodTableName";
}
else
{
this.query = "SELECT .... devTableName";
}
关于mysql - BIRT - org.eclipse.birt.data.engine.odaconsumer.OdaDataException : Cannot get the result set metadata,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31408780/