-->
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: Something simple, yet not working! Please help.
PostPosted: Thu Mar 29, 2007 8:42 am 
Newbie

Joined: Thu Mar 22, 2007 8:45 am
Posts: 8
I'm just trying to do very very simple query here and I'm getting this error below... I'm doing simple .list() operation in many other tables and they don't have any issues but only this table has an issue.
What could be possibly wrong? What does the error message "ResultSet ???? 1 ????? " mean?


protected static List getData ( )
{
Session session = HibernateUtil.getSessionFactory().openSession();
Transaction tx = session.beginTransaction();
List res = session.createCriteria(TblBankRate.class).list();
tx.commit();
session.close();

return res;
}

public static void main(String[] args) {
System.out.println( TblBankRateHandlerBean.getData() );
}



rg.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:2147)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028)
at org.hibernate.loader.Loader.list(Loader.java:2023)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:95)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
at com.everbank.service.model.TblBankRateHandlerBean.getData(TblBankRateHandlerBean.java:225)
at com.everbank.service.model.TblBankRateHandlerBean.main(TblBankRateHandlerBean.java:238)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]ResultSet ???? 1 ?????????????????????
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.base.BaseResultSet.validateColumnIndex(Unknown Source)
at com.microsoft.jdbc.base.BaseResultSet.getInt(Unknown Source)
at com.microsoft.jdbc.base.BaseResultSet.getInt(Unknown Source)
at org.hibernate.type.IntegerType.get(IntegerType.java:28)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:113)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:102)
at org.hibernate.type.ManyToOneType.hydrate(ManyToOneType.java:103)
at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2031)
at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1371)
at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1299)
at org.hibernate.loader.Loader.getRow(Loader.java:1197)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:568)
at org.hibernate.loader.Loader.doQuery(Loader.java:689)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2144)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 29, 2007 9:08 am 
Newbie

Joined: Thu Mar 22, 2007 8:45 am
Posts: 8
This TblBankRate has many to one relationship to TblAffiliate and when I take out the many-to-one relationship from TblBankRate.hbm.xml, the query works... but I need the relationship...

====in TblBankRate.hbm.xml=======If I take this section out, it works...=======

<many-to-one
name="TblAffiliate"
class="com.service.model.TblAffiliate"
not-null="true"
column ="IDdAffiliate" />

=== in TblAffiliate.hbm.xml ==========
<set
name="TblBankRate"
lazy="true"
inverse="true"
cascade="none"
>
<key>
<column name="IDAffiliate" />
</key>
<one-to-many
class="com.service.model.TblBankRate"
/>
</set>


Top
 Profile  
 
 Post subject: Never Mind
PostPosted: Thu Mar 29, 2007 9:47 am 
Newbie

Joined: Thu Mar 22, 2007 8:45 am
Posts: 8
This is not a Hibernate issue that I had behind this problem... so never mind.


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.