jQuery in Action, 2nd edition*
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
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Eclispe + Hibernate + DB2 version 9" Watch "Eclispe + Hibernate + DB2 version 9" New topic
Author

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
http://www.camilolopes.com/ About Java - Update every Week.
Guide SCJP - tips that you need know http://blog.camilolopes.com.br/livrosrevistaspalestras/
Dan Grazier
Greenhorn

Joined: Jan 08, 2010
Posts: 1
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

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

Joined: Aug 26, 2006
Posts: 4968
    
    1

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: http://aspose.com/file-tools
 
subject: Eclispe + Hibernate + DB2 version 9