2

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.

2
  • Have you sepecified the appropriate dialect? What's the stack trace of the exception? What's the generated SQL?
    – JB Nizet
    Sep 16, 2011 at 12:10
  • 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 Sep 16, 2011 at 13:23

2 Answers 2

4

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.

1
  • 1
    Anis, marking this answer as accepted would be the social stackoverflow way to show your gratitude
    – Jan Groth
    Sep 16, 2011 at 19:18
-1

You meant this query:

FROM User

Because the select tag in HQL doesn't have to be specified when you want to retrieve all the properties of the object.

2
  • From User return the same exception also, there is no difference, i don't understand how to retrieve all the propreties of objects with informix and hibernate. Sep 16, 2011 at 13:14
  • He says he is using JPA, and in JPQL the "SELECT user" is MANDATORY FOR PORTABLE CODE. Jan 2, 2016 at 18:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.