Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Eclispe + Hibernate + DB2 version 9

 
camilo lopes
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody,

I am trying to connect the DB2 via hibernate. But i received the message error below:


here, we have my hibernate configuration


any ideia?
 
Dan Grazier
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The key is in the SQLCODE=-798, SQLSTATE=428C9

Looking at db2 error codes on : http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com.ibm.db2.udb.msg.doc/doc/sql0798.htm

"Explanation:

When inserting or updating a row in a table, a value was specified for the GENERATED ALWAYS column column-name. GENERATED ALWAYS columns should not be specified in the column-list for an INSERT or in the SET clause for an update unless the keyword DEFAULT is specified.

The INSERT or UPDATE is not performed.
User response:

Remove the GENERATED ALWAYS column from the column-list or SET clause, or specify DEFAULT as the column value."

Sounds like you defined a column to be generated and are specifying a value in the insert. use "DEFAULT" for that value instead.
 
camilo lopes
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dan,

I have update my Bean and i received the error below:


Pessoa.java


any ideia?
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My first question is whether you can query an object? Can you?

Query an object from the database and print out its values. Then, update the object and save it. Then, delete it. Can you do these RUD functions?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic