lavanya shastri

Greenhorn
+ Follow
since Sep 22, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by lavanya shastri

Rayapudi Murali Krishna wrote:have you tried?
rs.getInt(1);



Yes it works now

@Anshul Agrawal Thanks!Appreciate the quick response
Hi ,

I need a little help with using the ResultSet object.
Basically, I have an sql query that is something like below

select count ( * ) from "UserBook" where "orderStatusID"= (select id from "OrderStatus" where name='NEW')

I execute this query and read it into a ResultSet object.Now the my problem is since the data baing returned is an Integer and not a bunch of rows/columns how do I access it from the ResultSet object

String query = select count ( * ) from "UserBook" where "orderStatusID"= (select id from "OrderStatus" where name='NEW') ;
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(query);

How do I access the integer returned to the ResultSet object.

Thanks,
LS