@Override public FullPrunedBlockStore createStore(NetworkParameters params, int blockCount) throws BlockStoreException { if(useSchema) { return new PostgresFullPrunedBlockStore(params, blockCount, DB_HOSTNAME, DB_NAME, DB_USERNAME, DB_PASSWORD, DB_SCHEMA); } else { return new PostgresFullPrunedBlockStore(params, blockCount, DB_HOSTNAME, DB_NAME, DB_USERNAME, DB_PASSWORD); } }
@Override public void resetStore(FullPrunedBlockStore store) throws BlockStoreException { ((PostgresFullPrunedBlockStore)store).resetStore(); }
@Override public void put(StoredBlock storedBlock, StoredUndoableBlock undoableBlock) throws BlockStoreException { maybeConnect(); conn.get().prepareStatement(getUpdateUndoableBlocksSQL()); s.setBytes(3, hashBytes); conn.get().prepareStatement(getInsertUndoableBlocksSQL()); s.setBytes(1, hashBytes); s.setInt(2, height); s.close(); try { putUpdateStoredBlock(storedBlock, true); } catch (SQLException e) { throw new BlockStoreException(e);
@After public void tearDown() throws Exception { ((PostgresFullPrunedBlockStore)store).deleteStore(); }
@Override public void put(StoredBlock storedBlock, StoredUndoableBlock undoableBlock) throws BlockStoreException { maybeConnect(); conn.get().prepareStatement(getUpdateUndoableBlocksSQL()); s.setBytes(3, hashBytes); conn.get().prepareStatement(getInsertUndoableBlocksSQL()); s.setBytes(1, hashBytes); s.setInt(2, height); s.close(); try { putUpdateStoredBlock(storedBlock, true); } catch (SQLException e) { throw new BlockStoreException(e);
@Override public void put(StoredBlock storedBlock, StoredUndoableBlock undoableBlock) throws BlockStoreException { maybeConnect(); conn.get().prepareStatement(getUpdateUndoableBlocksSQL()); s.setBytes(3, hashBytes); conn.get().prepareStatement(getInsertUndoableBlocksSQL()); s.setBytes(1, hashBytes); s.setInt(2, height); s.close(); try { putUpdateStoredBlock(storedBlock, true); } catch (SQLException e) { throw new BlockStoreException(e);
@Override public void put(StoredBlock storedBlock, StoredUndoableBlock undoableBlock) throws BlockStoreException { maybeConnect(); conn.get().prepareStatement(getUpdateUndoableBlocksSQL()); s.setBytes(3, hashBytes); conn.get().prepareStatement(getInsertUndoableBlocksSQL()); s.setBytes(1, hashBytes); s.setInt(2, height); s.close(); try { putUpdateStoredBlock(storedBlock, true); } catch (SQLException e) { throw new BlockStoreException(e);