aspose file tools*
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 Java 8 in Action this week in the Java 8 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to verify if an SQLJ iterator returns zero rows?
 
Similar Threads
Help me out with this....
DB2 700 and 701 - Test Sample
result null is null(urgent help)
db2 - 703 certification
Rowcount in Resultset