public int addBlockToDB( ) throws MiniDB_Exception{
    int newBlockID = (int)-1;

    for (int i=0; i<MiniDB_Constants.DB_MAX_BLOCKS && newBlockID==-1; i++){
      if( !dbBlockUsed[i] ){
	newBlockID = (int)i;
	dbBlockUsed[i] = true;
      }
    }

    if( newBlockID == -1 ) throw new MiniDB_Exception( MiniDB_Exception.DB_FULL );

    //MiniDB.log( "BufMgr.addBlockToDB, new block ID = " + newBlockID );

    return newBlockID;
  }