added empty result set testing

This commit is contained in:
Dave Cramer 2002-06-14 14:01:36 +00:00
parent 6e2fab0a41
commit fd8b153912
1 changed files with 20 additions and 0 deletions

View File

@ -63,4 +63,24 @@ public class ResultSetTest extends TestCase
stmt.close();
}
public void testEmptyResult()
{
try
{
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM testrs where id=100");
rs.beforeFirst();
rs.afterLast();
assertTrue(!rs.first());
assertTrue(!rs.last());
assertTrue(!rs.next());
}
catch ( Exception ex )
{
fail( ex.getMessage() );
}
}
}