DB2 « Column « JPA Q&A





1. Hibernate DB2 createNativeQuery adds extra column to result    forum.hibernate.org

When using Hibernate and DB2 I am getting an extra column returned in the result array. The following code should return an array of X elements, however with DB2 I am getting X+1 elements. Code: Query query = m_entityManager.createNativeQuery(sqlQuery); query.setParameter(1, someId); query.setMaxResults(pageSize); query.setFirstResult(pageSize * pageIndex); List results = query.getResultList(); for (Object resultObj : results) { Object[] result = (Object[]) resultObj; } ...

2. DB2 and byte[] primary key columns    forum.hibernate.org

Beginner Joined: Mon Nov 24, 2003 12:44 pm Posts: 40 I am having difficulties with using middlegen and hibernator against UDB7.2 fp5. The table definition is as follows... Code: Column Type Type ...

3. 'Numeric value out of range' with DB2 on BIGINIT column    forum.hibernate.org

Newbie Joined: Sat Feb 21, 2004 10:37 am Posts: 4 Location: USA, FL Hi All, I'm getting the TRAS0014I: The following exception was logged COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] CLI0111E Numeric value out of range. SQLSTATE=22003 at the following code if I use Long type for the argument. However it works OK if I use Integer. If I use pure JDBC calls it ...

4. Using DB2 auto generated identity columns    forum.hibernate.org

I have searched the FAQs and this forum so apologies if this is a common question. I have a DB2 (v8.2) table whose primary key is defined as follows IND_ID integer primary key GENERATED ALWAYS AS IDENTITY I have tried and failed to save the corresponding bean, no matter what I try. I have pasted the relevant snippets and log entries ...

5. DB2 and GENERATED ALWAYS identity column    forum.hibernate.org

CREATE TABLE TEST.CUSTOMER ( CUSTOMER_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1000, INCREMENT BY 1, NO CACHE, NO MINVALUE, NO MAXVALUE, NO CYCLE, NO ORDER), CUSTOMER_NAME VARCHAR(32) NOT NULL, ADDRESS_LINE_1 ...