-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Oracle Sql Error
PostPosted: Fri Oct 21, 2005 4:24 am 
Newbie

Joined: Fri Oct 21, 2005 4:14 am
Posts: 2
Hi, i get an Oracle Error (ORA-00933: SQL command not properly ended) when trying to run this litte code:
List users = s.createCriteria(User.class).list();

I changed the Config to my Mysql Testdatabase and it works correctly.

Thanks for helping.

Hibernate version: 3.0.5

Config documents:
<property name="connection.url">jdbc:oracle:thin:@localhost:1521:orcl</property>
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.username">xxx</property>
<property name="connection.password">xxx</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>

Mapping documents:
<!-- User -->
<class name="User" table="myorcl.hiber.user">
<id name="id" type="integer" column="kUser">
<generator class="increment"/>
</id>
<property name="registerdate" type="timestamp" column="cDate"/>
<property name="lastname" type="string" column="cLastname"/>
<property name="firstname" type="string" column="cFirstname"/>
<property name="email" type="string" column="cEmail"/>
<property name="loginname" type="string" column="cLoginname"/>
<property name="password" type="string" column="cPassword"/>
</class>

Full stack trace of any exception that occurs:
Exception in thread "main" org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:1596)
at org.hibernate.loader.Loader.list(Loader.java:1577)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:111)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1322)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:300)
at taptest.data.UserManager.getUserList(UserManager.java:70)
at taptest.data.UserManager.main(UserManager.java:77)
Caused by: java.sql.SQLException: ORA-00933: SQL command not properly ended

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:623)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:181)
at oracle.jdbc.driver.T4CPreparedStatement.execute_for_describe(T4CPreparedStatement.java:420)
at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:896)
at oracle.jdbc.driver.T4CPreparedStatement.execute_maybe_describe(T4CPreparedStatement.java:452)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:986)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2888)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:2929)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:120)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1272)
at org.hibernate.loader.Loader.doQuery(Loader.java:391)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218)
at org.hibernate.loader.Loader.doList(Loader.java:1593)
... 6 more


Name and version of the database you are using: Oracle 10g

The generated SQL (show_sql=true):
Hibernate: select this_.kUser as kUser0_, this_.cDate as cDate0_0_, this_.cLastname as cLastname0_0_, this_.cFirstname as cFirstname0_0_, this_.cEmail as cEmail0_0_, this_.cLoginname as cLoginname0_0_, this_.cPassword as cPassword0_0_ from myorcl.hiber.user this_


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 21, 2005 4:57 am 
Newbie

Joined: Fri Oct 14, 2005 1:27 am
Posts: 14
Location: Bangalore
Try executing the same query on the database -- i think "user" might be a keyword on oracle database --

-- Abhi


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 21, 2005 8:05 am 
Newbie

Joined: Fri Oct 21, 2005 4:14 am
Posts: 2
thank you for the hint, but it was another problem.
It was the table name: myorcl.hiber.user
i changed it to "user" and it worked


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.