public HsqlDataReader(org.hsqldb.Result result)
 {
     if (result == null)
     {
         throw new ArgumentNullException("result");
     }
     else if (result.isError())
     {
         throw new HsqlDataSourceException(result);
     }
     else if (result.isUpdateCount())
     {
         m_recordsAffected = result.getUpdateCount();
     }
     else if (result.isData())
     {
         m_recordsAffected = -1;
         m_result = result;
         m_fieldCount = result.getColumnCount();
         m_metaData = result.metaData;
         m_columnTypes = m_metaData.colTypes;
     }
     else
     {
         throw new InvalidOperationException(
             "Unhandled Result Mode: " + result.mode);
     }
 }