-->
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.  [ 2 posts ] 
Author Message
 Post subject: Looking for a feature like ResultSet.getString("colName
PostPosted: Tue Oct 23, 2007 8:49 am 
Newbie

Joined: Fri Apr 13, 2007 10:58 am
Posts: 10
Hello,

I have a query of this kind:

Code:
select col1, col2,col3
from tab1
where <my-filters>


Now i just want to fetch only the "col2" column's value in my class.Please note that due to some constraints, i cannot change my query to just use col2 in my select clause.


So how can i achieve this ? Any help would be appreciated.


Hibernate version: 3.0.2

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

Thanks,
Jignesh


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 23, 2007 10:19 am 
Regular
Regular

Joined: Mon Jan 22, 2007 10:32 am
Posts: 101
I couldn't get your problem. Execution of query you mentioned will always fetch all columns in select statement. If you are interested in just one column , you can get its value from returned object array.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.