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.  [ 1 post ] 
Author Message
 Post subject: Invalid ResultSet type error for Sybase named query
PostPosted: Fri Dec 21, 2007 8:04 am 
Newbie

Joined: Wed Jan 24, 2007 6:45 am
Posts: 4
Hi.

I'm getting the following error when trying to run a named query against a view on a Sybase 12.5 database:

util.JDBCExceptionReporter - SQL Error: 0, SQLState: JZ0SP
util.JDBCExceptionReporter - JZ0SP: Invalid ResultSet type: 50200832

Hibernate version: 3.2.5ga

Mapping documents:
Hibernate (not complete)
Code:
<property name="hibernate.dialect">org.hibernate.dialect.SybaseDialect</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.format_sql">true</property>
<property name="hibernate.use_outer_join">true</property>
<property name="hibernate.order_updates">true</property>
<property name="jta.UserTransaction">javax/transaction/UserTransaction</property>
<property name="hibernate.jdbc.batch_size">30</property>
<property name="hibernate.max_fetch_depth">3</property>
<property name="hibernate.session_factory_name">HibernateFactory</property>
<property name="connection.datasource">jdbc/MyDataSource</property>
<property name="connection.driver_class">com.sybase.jdbc2.jdbc.SybDriver</property>
<property name="connection.pool_size">1</property>
<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
<property name="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
<property name="hibernate.cache.use_second_level_cache">true</property>
<property name="hibernate.cache.use_query_cache">true</property>
<property name="hibernate.generate_statistics">true</property>
<property name="hibernate.cache.use_structured_entries">true</property>
<mapping resource="myViewVO.hbm.xml"/>


MyViewVO (not complete)
Code:
<query name="GetData"><![CDATA[
            FROM myViewVO WHERE someCol = 186
        ]]></query>


Code between sessionFactory.openSession() and session.close():
Code:
Query namedQuery = session.getNamedQuery("GetData");
List list = namedQuery.list();
System.out.println(list.size());


The following JDBC code works:
Code:
Class.forName("com.sybase.jdbc2.jdbc.SybDriver");
String url = "jdbc:sybase:Tds:myServer:myPort/myDb";
Connection conn = DriverManager.getConnection(url, "user", "pwd");
PreparedStatement s = conn.prepareStatement("select * from my_view where some_col = 186");
ResultSet srs = s.executeQuery();
while (srs.next())
{
   System.out.println(srs.getRow());
}


The JDBC connection in Weblogic (8.1 SP3) that hibernate uses has the same Sybase driver as used in the above test.

Any ideas?


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

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.