當前位置: 首頁>>代碼示例>>Java>>正文


Java DatabaseException.printStackTrace方法代碼示例

本文整理匯總了Java中com.sleepycat.je.DatabaseException.printStackTrace方法的典型用法代碼示例。如果您正苦於以下問題:Java DatabaseException.printStackTrace方法的具體用法?Java DatabaseException.printStackTrace怎麽用?Java DatabaseException.printStackTrace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.sleepycat.je.DatabaseException的用法示例。


在下文中一共展示了DatabaseException.printStackTrace方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: asyncAddItemToSort

import com.sleepycat.je.DatabaseException; //導入方法依賴的package包/類
public void asyncAddItemToSort(byte tbyData[], int nTotalLength, int nNbRecordRead, boolean bVariableLength)
	{
		// if only 1 dedicated thread is used for adding an item to sort 
		m_data.setData(tbyData, 0, nTotalLength);
		byte tbyKey[] = m_keyDescription.fillNewKeyBuffer(tbyData, nNbRecordRead, bVariableLength);
		m_key.setData(tbyKey);
		try
		{
			m_bdb.put(null, m_key, m_data);
			//unlock 
		}
		catch (DatabaseException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
//		unlock
	}
 
開發者ID:costea7,項目名稱:ChronoBike,代碼行數:19,代碼來源:BtreeFile.java

示例2: asyncAddItemToSortByMultiThreads

import com.sleepycat.je.DatabaseException; //導入方法依賴的package包/類
public void asyncAddItemToSortByMultiThreads(MultiThreadedSortAddItem multiThreadedSortItem, byte tbyData[])
{
	// if more than 1 dedicated thread are used for adding an item to sort
			
	DatabaseEntry data = new DatabaseEntry();
	data.setData(tbyData, 0, multiThreadedSortItem.m_nTotalLength);
	byte tbyKey[] = m_keyDescription.fillNewKeyBuffer(tbyData, multiThreadedSortItem.m_nNbRecordRead, multiThreadedSortItem.m_bVariableLength);
	
	//Dumper.dump("Record read="+multiThreadedSortItem.m_nNbRecordRead);
	//Dumper.dump(tbyKey);
	
	DatabaseEntry key = new DatabaseEntry();
	key.setData(tbyKey);
	try
	{
		m_bdb.put(null, key, data);
	}
	catch (DatabaseException e)
	{
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	
	m_multiThreadedSortItemCache.disposeItemForReuse(multiThreadedSortItem);
}
 
開發者ID:costea7,項目名稱:ChronoBike,代碼行數:26,代碼來源:BtreeFile.java

示例3: syncGetFirst

import com.sleepycat.je.DatabaseException; //導入方法依賴的package包/類
public byte [] syncGetFirst()
{	
	try
	{
		m_cursor = m_bdb.openCursor(null, null);
		OperationStatus status = m_cursor.getFirst(m_key, m_data, LockMode.DEFAULT);
		if(status == OperationStatus.SUCCESS)
		{
			m_nNbRecordExported = 1;
			byte tDataWithHeader[] = getDataRead();
			return tDataWithHeader;
		}
	}
	catch (DatabaseException e)
	{
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	return null;
}
 
開發者ID:costea7,項目名稱:ChronoBike,代碼行數:21,代碼來源:BtreeFile.java

示例4: syncGetNext

import com.sleepycat.je.DatabaseException; //導入方法依賴的package包/類
public byte [] syncGetNext()
{
	try
	{
		if(m_cursor != null)
		{
			OperationStatus status = m_cursor.getNext(m_key, m_data, LockMode.DEFAULT);
			if(status == OperationStatus.SUCCESS)
			{
				m_nNbRecordExported++;
				byte tDataWithHeader[] = getDataRead();
				return tDataWithHeader;
			}
		}				
	}
	catch (DatabaseException e)
	{
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	return null;
}
 
開發者ID:costea7,項目名稱:ChronoBike,代碼行數:23,代碼來源:BtreeFile.java

示例5: getGroundhog

import com.sleepycat.je.DatabaseException; //導入方法依賴的package包/類
public Groundhog getGroundhog(String groundhogName){
      
  Groundhog groundhog = null;
  File file = new File(baseDirectoryPath + groundhogName);

  if( file.isDirectory() ){
    
      try {
        groundhog = new Groundhog(file, defaultCacheSize);
        return groundhog;
      } catch (DatabaseException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
      
  }
  return groundhog;
}
 
開發者ID:BiosemanticsDotOrg,項目名稱:GeneDiseasePaper,代碼行數:19,代碼來源:GroundhogManager.java

示例6: setEntryInStore

import com.sleepycat.je.DatabaseException; //導入方法依賴的package包/類
@Override
protected void setEntryInStore(Integer id, ConceptVectorRecord value) {
  try {
    Transaction transaction = environment.beginTransaction(null, null);

    DatabaseEntry theDBKey = new DatabaseEntry();
    integerBinding.objectToEntry(id, theDBKey);
    DatabaseEntry theDBValue = new DatabaseEntry();
    recordDatabaseBinding.objectToEntry(value.getConceptVector(), theDBValue);
    groundhog.put(transaction, theDBKey, theDBValue);
    transaction.commit();
  } catch (DatabaseException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  }
}
 
開發者ID:BiosemanticsDotOrg,項目名稱:GeneDiseasePaper,代碼行數:17,代碼來源:Groundhog.java

示例7: getEntryFromStoreWithID

import com.sleepycat.je.DatabaseException; //導入方法依賴的package包/類
@Override
protected SortedIntList2IntMap getEntryFromStoreWithID(Integer id) {
  SortedIntList2IntMap result = null;
  try {
    DatabaseEntry databaseKey = new DatabaseEntry();
    DatabaseEntry databaseValue = new DatabaseEntry();
    myIntegerBinding.objectToEntry(id, databaseKey);
    cooccurrenceDB.get(null, databaseKey, databaseValue, LockMode.DEFAULT);
    if (databaseValue.getSize() != 0) {
      result = (SortedIntList2IntMap) myDataBinding.entryToObject(databaseValue);
    }
  } catch (DatabaseException e) {
    e.printStackTrace();
  }

  return result;
}
 
開發者ID:BiosemanticsDotOrg,項目名稱:GeneDiseasePaper,代碼行數:18,代碼來源:CooccurrenceDatabase.java

示例8: getEntryFromStoreWithID

import com.sleepycat.je.DatabaseException; //導入方法依賴的package包/類
@Override
public ConceptVectorRecord getEntryFromStoreWithID(Integer id) {
  ConceptVectorRecord record = new ConceptVectorRecord(id);

  DatabaseEntry theKey = new DatabaseEntry();
  integerBinding.objectToEntry(record.getID(), theKey);
  DatabaseEntry theValue = new DatabaseEntry();
  try {
    groundhog.get(null, theKey, theValue, LockMode.DEFAULT);
  } catch (DatabaseException e) {
    e.printStackTrace();
  }
  if (theValue.getSize() != 0) {
    record.setConceptVector((ConceptVector) recordDatabaseBinding.entryToObject(theValue));
    return record;
  }
  else {
    return null;
  }
}
 
開發者ID:BiosemanticsDotOrg,項目名稱:GeneDiseasePaper,代碼行數:21,代碼來源:Groundhog.java

示例9: init

import com.sleepycat.je.DatabaseException; //導入方法依賴的package包/類
private void init(File datadir){
  try {
    environmentConfig = new EnvironmentConfig();
    environmentConfig.setAllowCreate(true);
    environmentConfig.setTransactional(true);
    environmentConfig.setCacheSize(30240000);

    environment = new Environment(datadir, environmentConfig);

    databaseConfig = new DatabaseConfig();
    databaseConfig.setAllowCreate(true);
    databaseConfig.setTransactional(true);

    openDB();

    myIntegerBinding = TupleBinding.getPrimitiveBinding(Integer.class);
    myDataBinding = new Integer2Integer2IntegerMapBinding();
    
    sh = new CooccurrenceDatabaseShutdown();
    sh.c = this;
    Runtime.getRuntime().addShutdownHook(sh);
  } catch (DatabaseException e) {
    e.printStackTrace();
  }

}
 
開發者ID:BiosemanticsDotOrg,項目名稱:GeneDiseasePaper,代碼行數:27,代碼來源:CooccurrenceDatabase.java

示例10: next

import com.sleepycat.je.DatabaseException; //導入方法依賴的package包/類
public void next() {
  try {
    if (myCursor.getNext(foundKey, foundData, LockMode.DEFAULT) == OperationStatus.SUCCESS) {
      Integer key = (Integer) integerBinding.entryToObject(foundKey);
      conceptVectorRecord = new ConceptVectorRecord(key);
      conceptVectorRecord.setConceptVector((ConceptVector) recordDatabaseBinding.entryToObject(foundData));

    }
    else {

      close();
      conceptVectorRecord = null;
    }
  } catch (DatabaseException e) {

    e.printStackTrace();
  }
}
 
開發者ID:BiosemanticsDotOrg,項目名稱:GeneDiseasePaper,代碼行數:19,代碼來源:Groundhog.java

示例11: next

import com.sleepycat.je.DatabaseException; //導入方法依賴的package包/類
public ConceptVectorRecord next() {
  ConceptVectorRecord result = null;
  if (myCursor != null) {
    if (toggle) {
      result = next;
    }
    else {
      try {
        if (myCursor.getNext(foundKey, foundData, LockMode.DEFAULT) == OperationStatus.SUCCESS) {
          Integer key = (Integer) integerBinding.entryToObject(foundKey);
          result = new ConceptVectorRecord(key);
          result.setConceptVector((ConceptVector) recordDatabaseBinding.entryToObject(foundData));

        }

      } catch (DatabaseException e) {
        e.printStackTrace();
      }
    }
  }
  toggle = false;
  return result;
}
 
開發者ID:BiosemanticsDotOrg,項目名稱:GeneDiseasePaper,代碼行數:24,代碼來源:Groundhog.java

示例12: next

import com.sleepycat.je.DatabaseException; //導入方法依賴的package包/類
public Integer2IntegerSet next() {
  Integer2IntegerSet result = null;
  if (myCursor != null) {
    if (nextHasBeenRetrieved) {
      result = next;
    }
    else {
      try {
        if (myCursor.getNext(foundKey, foundData, LockMode.DEFAULT) == OperationStatus.SUCCESS) {
          Integer key = (Integer) myIntegerBinding.entryToObject(foundKey);
          SortedIntListSet set = (SortedIntListSet) myDataBinding.entryToObject(foundData);
          result = new Integer2IntegerSet(key, set);

        }

      } catch (DatabaseException e) {
        e.printStackTrace();
      }
    }
  }
  nextHasBeenRetrieved = false;
  return result;
}
 
開發者ID:BiosemanticsDotOrg,項目名稱:GeneDiseasePaper,代碼行數:24,代碼來源:IntegerSetStore.java

示例13: readNext

import com.sleepycat.je.DatabaseException; //導入方法依賴的package包/類
private void readNext() {
	if (myCursor != null) {
		try {
	if (myCursor.getNext(foundKey, foundData, LockMode.DEFAULT) == OperationStatus.SUCCESS) {
		Integer key = (Integer) myIntegerBinding.entryToObject(foundKey);
		next = (ConceptToConceptVectorRecordIndexEntry) myDataBinding.entryToObject(foundData);
		next.key = key;
	} else {
		next = null;
		myCursor.close();
	}
} catch (DatabaseException e) {
	e.printStackTrace();
}
	}
}
 
開發者ID:BiosemanticsDotOrg,項目名稱:GeneDiseasePaper,代碼行數:17,代碼來源:ConceptToRecordIndex.java

示例14: internalSortInsertWithRecordIndexAtEnd

import com.sleepycat.je.DatabaseException; //導入方法依賴的package包/類
public boolean internalSortInsertWithRecordIndexAtEnd(byte tbyData[], int nSourceOffset, int nTotalLength, int nNbRecordRead, boolean bVariableLength)  
{
	if(m_nNbthreadsSort == 0)	// No thread for sorting
	{
		byte tbyKey[] = m_keyDescription.fillKeyBuffer(tbyData, 0, nNbRecordRead, bVariableLength);

		//LittleEndingUnsignBinaryBufferStorage.writeInt(tbyKey, nNbRecordRead, m_keyDescription.m_nKeyLength-4);	// Intel format
		
		m_data.setData(tbyData, 0, nTotalLength);
		m_key.setData(tbyKey);
		try
		{
			m_bdb.put(null, m_key, m_data);
			return true;
		}
		catch (DatabaseException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return false;
	}
	else // Multi threads for sorting
	{
		// Insert real record
		MultiThreadedSortAddItem item = m_multiThreadedSortItemCache.getUsusedItem();
		if(item == null)
			item = new MultiThreadedSortAddItem(this, tbyData, nSourceOffset, nTotalLength, nNbRecordRead, bVariableLength);
		else
			item.fill(this, tbyData, nSourceOffset, nTotalLength, nNbRecordRead, bVariableLength);
		m_threadsPoolWriter.enqueue(item);
		return true;
	}
}
 
開發者ID:costea7,項目名稱:ChronoBike,代碼行數:35,代碼來源:BtreeFile.java

示例15: externalSortInsertWithRecordIndexAtEnd

import com.sleepycat.je.DatabaseException; //導入方法依賴的package包/類
public boolean externalSortInsertWithRecordIndexAtEnd(Environment env, LineRead lineRead, int nNbRecordRead, boolean bFileInEbcdic, boolean bFileInVariableLength)  
{
	byte tbyData[] = lineRead.getBuffer();
	int nOffset = lineRead.getOffset();
	int nTotalLength = lineRead.getTotalLength();
	
	if(m_nNbthreadsSort == 0)	// No thread for sorting
	{
		byte tbyKey[] = m_keyDescription.fillKeyBufferExceptRecordId(lineRead, bFileInVariableLength);	//, bFileInEbcdic);

		LittleEndingUnsignBinaryBufferStorage.writeInt(tbyKey, nNbRecordRead, m_keyDescription.m_nKeyLength-4);	// Write record id at the end of the key

		m_data.setData(tbyData, nOffset, nTotalLength);
		m_key.setData(tbyKey);
		//Dumper.dump("Record read="+nNbRecordRead);
		//Dumper.dump(tbyKey);
		try
		{
			m_bdb.put(null, m_key, m_data);
			return true;
		}
		catch (DatabaseException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return false;
	}
	else
	{
		MultiThreadedSortAddItem item = m_multiThreadedSortItemCache.getUsusedItem();
		if(item == null)
			item = new MultiThreadedSortAddItem(this, tbyData, nOffset, nTotalLength, nNbRecordRead, bFileInVariableLength);
		else
			item.fill(this, tbyData, nOffset, nTotalLength, nNbRecordRead, bFileInVariableLength);
		//MultiThreadedSortAddItem item = new MultiThreadedSortAddItem(this, tbyData, nOffset, nTotalLength, nNbRecordRead, bFileInVariableLength);
		m_threadsPoolWriter.enqueue(item);
		return true;
	}
}
 
開發者ID:costea7,項目名稱:ChronoBike,代碼行數:41,代碼來源:BtreeFile.java


注:本文中的com.sleepycat.je.DatabaseException.printStackTrace方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。