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

  • Home
  • SEARCH
  • 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 8098081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:58:07+00:00 2026-06-05T21:58:07+00:00

When using hibernate to retrieve data from Oracle 11g DB using either org.hibernate.dialect.Oracle10gDialect or

  • 0

When using hibernate to retrieve data from Oracle 11g DB using either org.hibernate.dialect.Oracle10gDialect or org.hibernate.dialect.OracleDialect
I get the following:

org.hibernate.exception.SQLGrammarException: could not execute query
Caused by: java.sql.SQLSyntaxErrorException: ORA-00923: FROM keyword not found where expected

Looking in the log we can see the query:

select top ? this_.LI_ILN as LI1_8_0_, this_.COUNTRY_CODE ... 

Obviously, the DB doesn’t recognize the keyword and this is where the problem lies, because in Oracle pagination can only be done by using ROWNUM, a thing which Hibernate should know.

The hibernate configuration looks as follows:

<hibernate-configuration>
<session-factory name="HibernateSessionFactory">
    <property name="hibernate.bytecode.use_reflection_optimizer">false</property>
    <property name="hibernate.connection.driver_class">oracle.jdbc.OracleDriver</property>
    <property name="hibernate.connection.password">...</property>
    <property name="hibernate.connection.url">...</property>
    <property name="hibernate.connection.username">...</property>
    <property name="hibernate.default_schema">...</property>
    <property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
    <property name="hibernate.search.autoregister_listeners">false</property>
    <property name="hibernate.show_sql">true</property>
    <property name="hibernate.hbm2ddl.auto">validate</property>
    <property name="hibernate.transaction.auto_close_session">false</property>

    <mapping resource="HB_Mappings/Supplier.hbm.xml" />
</session-factory>

The query is done like so:

Criteria crit = sessionFactory.getCurrentSession().createCriteria(Supplier.class);
crit.setFirstResult(50 * pageIndex);
crit.setMaxResults(50);

List<Supplier> list = crit.list();

Any help is appreciated.


Solved:

Forgot to mention that I am using spring in which the applicationContext.xml looks like:

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    <property name="dataSource" ref="dataSource" />
    <property name="configLocation">
        <value>classpath:HB_Mappings/hibernate.cfg.xml</value>
    </property>
    <property name="hibernateProperties">
        <value>hibernate.dialect=org.hibernate.dialect.HSQLDialect</value>
    </property>
</bean>

It overwrote the hibernate.cfg.xml’s property…

Note to self: go easy on copy-paste

  • 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-05T21:58:09+00:00Added an answer on June 5, 2026 at 9:58 pm

    OracleDialect is deprecated, see here:
    http://docs.jboss.org/hibernate/core/4.1/javadocs/org/hibernate/dialect/OracleDialect.html

    Use the Oracle10gDialect instead: http://docs.jboss.org/hibernate/core/4.1/javadocs/org/hibernate/dialect/Oracle10gDialect.html

    Also Check this out, and make sure that you are using the newest Oracle JDBC driver.

    https://web.archive.org/web/20130204044852/https://community.jboss.org/wiki/SupportedDatabases2

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

To retrieve data from database using Hibernate, I use the following syntax : Query
Hello I have the following code to retrieve data from my db using nhibernate
I'm using Hibernate to retrieve some data from a database. The result set returned
I'm using hibernate template to retrieve a data from the table course which has
I am using GWT RPC & Hibernate to insert and retrieve data from MySql
I am using GWT RPC & Hibernate to insert and retrieve data from MySQL
I developing a paged service to retrieve data from database using NHibernate. In my
I'm trying to retrieve the result from a stored procedure by using Hibernate in
I'm using NHibernate to retrieve a list from the database based on some criteria.
I have build my data model using JPA and am using Hibernate's EntityManager 3

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.