*
The moose likes JDBC and the fly likes How to verify if an SQLJ iterator returns zero rows? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to verify if an SQLJ iterator returns zero rows? " Watch "How to verify if an SQLJ iterator returns zero rows? " New topic
Author

How to verify if an SQLJ iterator returns zero rows?

sharath kv
Greenhorn

Joined: May 06, 2003
Posts: 20
Hi ,
I want to know how to verify if an SQLJ iterator is returning zero rows as a result of an SQL query.
Example:
#sql iter = { SQL-statement };
I want to verify if the iterator iter is containing zero or more rows(or values) before further processing.
I tried using this method,but was not successful
if(iter.cloumn-name()== null)
{
break;
}
I also tried converting the iterator to a JDBC resultset as follows:
ResultSet b = iter.getResultSet();
if(b == null)
{
break;
}
This approach also was not successful.
Irene Loos
Ranch Hand

Joined: Apr 15, 2002
Posts: 78
You can check if it has next element, like this:


Irene Loos
 
wood burning stoves
 
subject: How to verify if an SQLJ iterator returns zero rows?
 
Similar Threads
result null is null(urgent help)
Rowcount in Resultset
DB2 700 and 701 - Test Sample
db2 - 703 certification
Help me out with this....