使用Informix的Hibernate查询问题 [英] Hibernate Query problem with Informix
问题描述
我已经使用Seam 2.2.1& MySQL正在工作。我现在试图将应用程序连接到 Informix ,并且当我从 hibernate 执行查询时(从User用户选择用户
)我收到以下例外:
org.hibernate.exception.genericjdbcexception无法执行查询
当我以身份执行查询时,从用户用户选择user.id,user.name
它会成功执行。
生成的sql是
lockquote
select
first 2 user0_.USER_ID作为USER1_120_,
user0_.dateOfBirth作为dateOfBi2_120_,
user0_.enabled作为enabled120_,
user0_.forename作为forename120_,
user0_.password作为password120_,
user0_.surname as surname120_,
user0_.userName as userName120_
from
anetidb.user user0_
where
username =?
例外的Stacktrace:
12:00:24,407信息[IntegerType]可以不从结果集中读取列值:USER1_120_;没有这样的列名
12:00:24,665 WARN [JDBCExceptionReporter] SQL错误:-79738,SQLState:IX000
12:00:24,873错误[JDBCExceptionReporter]没有这样的列名称
而我使用org.hibernate.dialect.InformixDialect作为hibernate.dialect
问题?
Thks For Help。
c>没有这样的列名informix hibernate 让我看到下面的Hibernate bug报告,它描述了完全相同的问题: https://hibernate.onjira.com/browse/HBX-1126
该解决方案似乎删除数据源URL中的参数DELIMIDENT = y。
I have written an application using Seam 2.2.1 & MySQL which is working. I am now trying to connect the application to Informix and when I execute a query from hibernate(select user from User user
) I am getting the following exceptions:
org.hibernate.exception.genericjdbcexception could not execute query
when i execute a query as select user.id,user.name from User user
it's executed successefuly.
The Generated sql is
select first 2 user0_.USER_ID as USER1_120_, user0_.dateOfBirth as dateOfBi2_120_, user0_.enabled as enabled120_, user0_.forename as forename120_, user0_.password as password120_, user0_.surname as surname120_, user0_.userName as userName120_ from anetidb.user user0_ where username=?
The Stacktrace of exception:
12:00:24,407 INFO [IntegerType] could not read column value from result set: USER1_120_; No such column name 12:00:24,665 WARN [JDBCExceptionReporter] SQL Error: -79738, SQLState: IX000 12:00:24,873 ERROR [JDBCExceptionReporter] No such column name
And i Use org.hibernate.dialect.InformixDialect as hibernate.dialect
Have you an idea about the problem?
Thks For Help.
Googling for "No such column name" informix hibernate
has led me to the following Hibernate bug report, which describes exactly the same problem: https://hibernate.onjira.com/browse/HBX-1126
The solution seems to remove the parameter DELIMIDENT=y from the datasource URL.
这篇关于使用Informix的Hibernate查询问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!