Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8223007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:31:05+00:00 2026-06-07T14:31:05+00:00

Edit1: When Hibernate connected to MS-SQL, all columns and tables are scanning. Logs But

  • 0

Edit1:
When Hibernate connected to MS-SQL, all columns and tables are scanning. Logs

But when Hibernate connected to DB2, it is trying to make out (render) again all tables and columns which include ”i” letter. Logs

After I scanned the tables and columns I realised that all letters was big.In fact , every letter was big on DB2.
Hibernate uses small letters for inquiry and because of DB2’s big letter sensitivity it does not realise column names. For that reason, it gives an alarm which is in below,

WARN SqlExceptionHelper: SQL Error: -99999, SQLState: 42703 
15:15:22,025 ERROR SqlExceptionHelper: An undefined column name was detected.

How can I solve this problem?


I have to retrieve data from a table in db2 using jpa.
When I try to execute a query using the entity manager I get errors don’t know where is the problem exactly.
My code running on MS-SQL and HSQL-DB… But I connect DB2 the message error : *

  • Query qry = em.createQuery(“from Holding h where h.RDeleted=:arg1”);-

    13:26:38,135 DEBUG SQL: select holding0_.HoldingId as HoldingId1_, holding0_.RDeleted as RDeleted1_, holding0_.InsertDate as InsertDate1_, holding0_.SavesUserId as SavesUse4_1_, holding0_.UpdateDate as UpdateDate1_, holding0_.Updater as Updater1_, holding0_.Description as Descript7_1_, holding0_.HoldingName as HoldingN8_1_ from Holding holding0_ where holding0_.RDeleted=?
    Hibernate: select holding0_.HoldingId as HoldingId1_, holding0_.RDeleted as RDeleted1_, holding0_.InsertDate as InsertDate1_, holding0_.SavesUserId as SavesUse4_1_, holding0_.UpdateDate as UpdateDate1_, holding0_.Updater as Updater1_, holding0_.Description as Descript7_1_, holding0_.HoldingName as HoldingN8_1_ from Holding holding0_ where holding0_.RDeleted=?
    13:26:38,428 WARN SqlExceptionHelper: SQL Error: -99999, SQLState: 42703
    13:26:38,428 ERROR SqlExceptionHelper: An undefined column name was detected.

But it query works:

Select h.holdingId, h.holdingName, h.description from Holding h

My Datasource:

<bean class="org.apache.commons.dbcp.BasicDataSource" id="dataSourceDB2_JT400" destroy-method="close">
        <property value="com.ibm.as400.access.AS400JDBCDriver" name="driverClassName"/> 
        <property value="jdbc:as400://192.168.1.1/GULERP" name="url"/> 
        <property value="user" name="username"/> 
        <property value="PW" name="password"/> 
        <property value="5" name="initialSize"/>
    </bean>

My entityManager:

<bean id="entityManagerFactory"
        class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
        <property name="persistenceUnitName" value="erp" />
        <property name="jpaVendorAdapter">
            <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
                <property name="showSql" value="true" />
                <property name="generateDdl" value="false" />
                <property name="databasePlatform" value="org.hibernate.dialect.DB2400Dialect" />
            </bean>
        </property>
        <property name="dataSource" ref="dataSourceDB2_JT400"/>
    </bean>

and My domain:

@Entity
@AccessType("field")
@Table(name = "Holding", uniqueConstraints = {@UniqueConstraint(columnNames={"HoldingName"})})
public class Holding extends BaseClass implements Serializable {

    transient static final long serialVersionUID = 5473887143181971744L;

    @Id
    @Column(name = "HoldingId", nullable = false, length=36)
    @GeneratedValue(generator="system-uuid")
    @GenericGenerator(name = "system-uuid", strategy = "uuid")
    private String holdingId;

    @Basic(optional = false)
    @Column(name = "HoldingName", nullable = false, length = 100)
    private String holdingName;

    @Column(name = "Description", length = 210)
    private String description;

    @OneToMany(mappedBy = "holdingId", fetch = FetchType.LAZY)
    private List<Company> companyList;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T14:31:07+00:00Added an answer on June 7, 2026 at 2:31 pm

    Solution:

        @Override
        @PreAuthorize("hasRole('ROLE_ADMIN')")
        public List<HoldingDto> getHoldingList()
        {
            List<HoldingDto> holdLst = null;
            try
            {
                String aa = (String) q.getSingleResult();
    
                CriteriaBuilder cb = em.getCriteriaBuilder();
                CriteriaQuery<HoldingDto> q = cb.createQuery(HoldingDto.class);
                Root<Holding> h = q.from(Holding.class);
                q.select(cb.construct(HoldingDto.class, h.get("holdingId"), h.get("holdingName"), h.get("description"), h.get("savesUserId"), h.get("insertDate"),
                        h.get("updateDate"), h.get("updater"), h.get("RDeleted")));
                holdLst = em.createQuery(q).getResultList();
            } 
            catch(NoResultException e)
            {
                e.printStackTrace();
            }
            catch (Exception e)
            {
                throw new RuntimeException(e);
            }
    
            return holdLst;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am trying to learn Java, Hibernate and the MVC pattern. Following various tutorial
There must be a simple solution out there, I'm trying to use NHibernate Validator
Im using Struts2 and Hibernate, trying to create a simple form to edit an
I'm trying to follow this tutorial, but VS debugger keep asking me for a
How can I configure Hibernate so it maps beans to some existing tables? P.S:
I'm trying to convert to list of hibernate objects to XML using JAXB. Are
I found some instructions how to configure pure hibernate to use EHCache. But I
I'm using Hibernate 3.5.5.Final and JPA2 How can make a testcase to test if
Here is my hibernate config, but for some reason it fails to load those
Edit1: Updated my method. I think it helped... I wont be able to be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.