This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Eclispe + Hibernate + DB2 version 9 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Eclispe + Hibernate + DB2 version 9" Watch "Eclispe + Hibernate + DB2 version 9" New topic

Eclispe + Hibernate + DB2 version 9

camilo lopes
Ranch Hand

Joined: Aug 08, 2007
Posts: 202
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?

Brazil - Sun Certified Java Programmer - SCJP 5 About Java - Update every Week.
Guide SCJP - tips that you need know
Dan Grazier

Joined: Jan 08, 2010
Posts: 1
The key is in the SQLCODE=-798, SQLSTATE=428C9

Looking at db2 error codes on :


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

Joined: Aug 08, 2007
Posts: 202
Hi Dan,

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

any ideia?
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

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?
I agree. Here's the link:
subject: Eclispe + Hibernate + DB2 version 9
It's not a secret anymore!