SQLResultSet implements IPentahoResultSet, IPeekable { public int getColumnCount() { if ( columnCount != SQLResultSet.COUNT_NEVER_OBTAINED ) { return columnCount; } if ( nativeResultSet == null ) { return 0; } try { columnCount = nativeResultSet.getMetaData().getColumnCount(); return columnCount; } catch ( SQLException ex ) { SQLResultSet.log.error( Messages.getInstance().getErrorString( "SQLResultSet.ERROR_0006_GET_COLUMNCOUNT" ), ex ); } return 0; } SQLResultSet( final ResultSet nativeResultSet, final SQLConnection nativeConnection ); void setMetaData( final IPentahoMetaData metadata ); IPentahoMetaData getMetaData(); Object[] peek(); Object[] next(); void closeConnection(); void close(); void dispose(); boolean isScrollable(); int getColumnCount(); int getRowCount(); Object getValueAt( final int row, final int column ); IPentahoResultSet memoryCopy(); void beforeFirst(); Object[] getDataColumn( final int column ); Object[] getDataRow( final int row );  }
@Test public void testGetColumnCountNativeNull() { SQLResultSet resultSet = new SQLResultSet( null, nativeConnection ); assertEquals( 0, resultSet.getColumnCount() ); }
@Test public void testGetColumnCount() { SQLResultSet resultSet = new SQLResultSet( nativeResultSet, nativeConnection ); assertEquals( columns[0].length, resultSet.getColumnCount() ); }