• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 218
  • Last Modified:

Printout Results from Count Query

Hi there,
I want to print out the results set from query:

CODE:

ResultSet rs56= Statement.executeQuery("SELECT count(*)FROM Test_Results ");

I have run the query in the db and the result should be a count of 13.

I have in the past used: <%=rs56.getString("County")%>, but there is no field name for this results.

Thanks
Regards
0
acslater
Asked:
acslater
1 Solution
 
nagkiCommented:
acslater,
u can rename count(*) to some other variable name like this
ResultSet rs56= Statement.executeQuery("SELECT count(*) as cnt FROM Test_Results ");
rs56.getInteger("cnt");

Nagki
0
 
acslaterAuthor Commented:
Nagki,
Thanks... that worked...
Regards,
acslater
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now