-->
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: Find out number of columns of a ScrollableResult
PostPosted: Fri Jan 30, 2004 5:56 am 
Beginner
Beginner

Joined: Thu Jan 22, 2004 6:16 am
Posts: 40
Location: Luxembourg
How do I get out the number of columns from a ScrollableResult ?

When using the java.sql package, it can be done like this :

//Assume results is of class java.sql.ResultSet
//Assume rsmd id os class java.sql.ResultSetMetaData

rsmd = results.getMetaData ( );
numCols = rsmd.getColumnCount ( );

How do I do the similar with Hibernate ?
For the moment, I have the following code :

//Assume hql is an interface of net.sf.hibernate.Query
//Assume results is an interface of net.sf.hibernate.ScrollableResult
hql = session.createQuery(sql);
results = hql.scroll();

How do I continue to get the number of columns out from "results"

Cheers


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.