Here is the output of your example class "z":

Next column is called TABLEID
Next column is called TABLENAME
Next column is called TABLETYPE
Next column is called SCHEMAID
Next column is called LOCKGRANULARITY

Interesting, but my code started to work:

public final void testGetColumns() throws SQLException {
java.sql.ResultSet column_set = metadata.getColumns(null, "SYS", "SYSTABLES", "%");
//For scrollable result set:
//For updatable result set:
//int i=0;
//while ( )
String column_name = column_set.getString(3);


JUnit test reporter indicates this test passed("green" state). System.out.prinln() pushed following into output stream:


The same is for while() loop.

Thanks help. The courious thing is that I remember exactly that in one of my previous tryouts there where only next(), but an exception about undefined cursor state fired. Hm,..
By the way - metadata connection was properly defined in setUp().

P.S. In normal unit tests it is a bad idea to write into System.out stream. Normally it should be written into logger (Log4j). Otherwise, in some cases, benchmarks would not be usable; if data writing operation would take much more time than assertions. John