This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Servlets and the fly likes ResultSet please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "ResultSet please help" Watch "ResultSet please help" New topic
Author

ResultSet please help

santosh vashist
Greenhorn

Joined: May 14, 2001
Posts: 25
Hi all,
I want to check if resultset contains some record or not.
How to do this with using next().can any body help please.

thanks,
santosh
Sandeep Jain
Ranch Hand

Joined: Oct 25, 2000
Posts: 124
hello ,
U camen make use od if condition there ie
ResultSet rs=stmt.executeQuery("UR Query");
if(rs.next())
{
while(rs.next())
{
String item1=rs.getString(1);
bla
bla
bla
}
}
rs.close();
stmt.close();

------------------
Try and Try Till u succeed
Sandeep Jain


Try and Try Till u succeed<br /> <br />Sandeep Jain
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: ResultSet please help
 
Similar Threads
java.rmi.UnMarshalException
reading image from database
Scrollable resultset for prepared statement
difference between sensitive and insensitive of resultset
How to find the size of my resultSet