Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Object Relational Mapping
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
paul wheaton
Ron McLeod
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Saloon Keepers:
Tim Holloway
Roland Mueller
Bartenders:
Forum:
Object Relational Mapping
could not execute query
Omar Mohaidat
Ranch Hand
Posts: 34
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hello..
I am using hibernate to get data from oracle DB. these my configuration files:
hibernate.cfg.xml
<?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <!-- Database connection settings --> <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property> <property name="connection.url">jdbc:oracle:thin:@pmisdevtest.works.gov.bh:1529:test</property> <property name="connection.username">apps</property> <property name="connection.password">apps</property> <!-- JDBC connection pool (use the built-in) --> <property name="connection.pool_size">3</property> <!-- SQL dialect --> <property name="dialect">org.hibernate.dialect.Oracle10gDialect</property> <!-- Enable Hibernate's automatic session context management --> <property name="current_session_context_class">thread</property> <!-- Disable the second-level cache --> <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property> <!-- Echo all executed SQL to stdout --> <property name="show_sql">true</property> <property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property> <mapping resource="cas.hbm.xml"/> </session-factory> </hibernate-configuration>
cas.hbm.xml:
<?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <class name="com.eacom.pmis.beans.DocInfo" table="XXCAS_ATTACHMENT_DATA"> <id name="seqNo" type="integer" column="SEQNO"> <generator class="sequence"> <param name="sequence">xxcas_doc_upload</param> </generator> </id> <property name="itemId" type="string" column="FILE_ID"/> <property name="reqId" type="integer" column="REQUEST_ID"/> <property name="catCode" type="string" column="ATTCH_CATG_CODE"/> <property name="docType" type="string" column="ATTCH_SUB_CODE"/> <property name="fileName" type="string" column="FILE_NAME"/> <property name="desc" type="string" column="DESCRIPTION"/> <property name="attaRoleId" type="integer" column="ATTACHED_ROLE_ID"/> </class> </hibernate-mapping>
I am using this statement to get Data
query = getSession().createQuery("from XXCAS_ATTACHMENT_DATA"); docsInfoList = query.list();
but I got this exception:
JDBCExceptionReporter - ORA-00936: missing expression org.hibernate.exception.SQLGrammarException: could not execute query at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.loader.Loader.doList(Loader.java:2216) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104) at org.hibernate.loader.Loader.list(Loader.java:2099) at org.hibernate.hql.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:912) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) at com.eacom.pmis.dao.CAS_DAO.getDocsInfo(CAS_DAO.java:62) at com.eacom.pmis.edms.CMBControlServletWrapper.getDocsInfo(CMBControlServletWrapper.java:393) at com.eacom.pmis.edms.CMBControlServletWrapper.service(CMBControlServletWrapper.java:109) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:734) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:391) at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:908) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:458) at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:226) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:127) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:116) at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260) at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:234) at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:29) at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:879) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298) at java.lang.Thread.run(Thread.java:619) Caused by: java.sql.SQLException: ORA-00936: missing expression at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282) at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:185) at oracle.jdbc.driver.T4CPreparedStatement.execute_for_describe(T4CPreparedStatement.java:503) at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:1029) at oracle.jdbc.driver.T4CPreparedStatement.execute_maybe_describe(T4CPreparedStatement.java:535) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1126) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3001) at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3043) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186) at org.hibernate.loader.Loader.getResultSet(Loader.java:1787) at org.hibernate.loader.Loader.doQuery(Loader.java:674) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236) at org.hibernate.loader.Loader.doList(Loader.java:2213) ... 23 more
any help please
Omar Mohaidat
Ranch Hand
Posts: 34
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
resolved. I used the table name instead of POJO name in DAO class... this is the problem.
Slideshow boring ... losing consciousness ... just gonna take a quick nap on this tiny ad ...
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
spring + hibernate
Hibernate native sql problem
hibernate exception SQLGrammarException could not fetch initial value for increment
java.sql.SQLException: No suitable driver
One To Many Unidirectional(Hibernate)
More...