亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? sample.java

?? Oracle BerkeleyDB(Oracle內(nèi)嵌數(shù)據(jù)庫
?? JAVA
字號:
/*- * See the file LICENSE for redistribution information. * * Copyright (c) 2002-2006 *	Oracle Corporation.  All rights reserved. * * $Id: Sample.java,v 12.4 2006/08/24 14:45:57 bostic Exp $ */package collections.ship.index;import java.io.FileNotFoundException;import java.util.Iterator;import java.util.Map;import com.sleepycat.collections.StoredIterator;import com.sleepycat.collections.TransactionRunner;import com.sleepycat.collections.TransactionWorker;import com.sleepycat.db.DatabaseException;/** * Sample is the main entry point for the sample program and may be run as * follows: * * <pre> * java collections.ship.index.Sample *      [-h <home-directory> ] * </pre> * * <p> The default for the home directory is ./tmp -- the tmp subdirectory of * the current directory where the sample is run. The home directory must exist * before running the sample.  To recreate the sample database from scratch, * delete all files in the home directory before running the sample.  </p> * * @author Mark Hayes */public class Sample {    private SampleDatabase db;    private SampleViews views;    /**     * Run the sample program.     */    public static void main(String[] args) {        System.out.println("\nRunning sample: " + Sample.class);        // Parse the command line arguments.        //        String homeDir = "./tmp";        for (int i = 0; i < args.length; i += 1) {            if (args[i].equals("-h") && i < args.length - 1) {                i += 1;                homeDir = args[i];            } else {                System.err.println("Usage:\n java " + Sample.class.getName() +				   "\n  [-h <home-directory>]");                System.exit(2);            }        }        // Run the sample.        //        Sample sample = null;        try {            sample = new Sample(homeDir);            sample.run();        } catch (Exception e) {            // If an exception reaches this point, the last transaction did not            // complete.  If the exception is RunRecoveryException, follow            // the Berkeley DB recovery procedures before running again.            e.printStackTrace();        } finally {            if (sample != null) {                try {                    // Always attempt to close the database cleanly.                    sample.close();                } catch (Exception e) {                    System.err.println("Exception during database close:");                    e.printStackTrace();                }            }        }    }    /**     * Open the database and views.     */    private Sample(String homeDir)        throws DatabaseException, FileNotFoundException {        db = new SampleDatabase(homeDir);        views = new SampleViews(db);    }    /**     * Close the database cleanly.     */    private void close()        throws DatabaseException {        db.close();    }    /**     * Run two transactions to populate and print the database.  A     * TransactionRunner is used to ensure consistent handling of transactions,     * including deadlock retries.  But the best transaction handling mechanism     * to use depends on the application.     */    private void run()        throws Exception {        TransactionRunner runner = new TransactionRunner(db.getEnvironment());        runner.run(new PopulateDatabase());        runner.run(new PrintDatabase());    }    /**     * Populate the database in a single transaction.     */    private class PopulateDatabase implements TransactionWorker {        public void doWork()            throws Exception {            addSuppliers();            addParts();            addShipments();        }    }    /**     * Print the database in a single transaction.  All entities are printed     * and the indices are used to print the entities for certain keys.     *     * <p> Note the use of special iterator() methods.  These are used here     * with indices to find the shipments for certain keys.  For details on     * database iterators see {@link StoredIterator}. </p>     */    private class PrintDatabase implements TransactionWorker {        public void doWork()            throws Exception {            printEntries("Parts",			 views.getPartEntrySet().iterator());            printEntries("Suppliers",			 views.getSupplierEntrySet().iterator());            printValues("Suppliers for City Paris",			views.getSupplierByCityMap().duplicates(							"Paris").iterator());            printEntries("Shipments",			 views.getShipmentEntrySet().iterator());            printValues("Shipments for Part P1",			views.getShipmentByPartMap().duplicates(						new PartKey("P1")).iterator());            printValues("Shipments for Supplier S1",			views.getShipmentBySupplierMap().duplicates(					    new SupplierKey("S1")).iterator());        }    }    /**     * Populate the part entities in the database.  If the part map is not     * empty, assume that this has already been done.     */    private void addParts() {        Map parts = views.getPartMap();        if (parts.isEmpty()) {            System.out.println("Adding Parts");            parts.put(new PartKey("P1"),                      new PartData("Nut", "Red",                                    new Weight(12.0, Weight.GRAMS),                                    "London"));            parts.put(new PartKey("P2"),                      new PartData("Bolt", "Green",                                    new Weight(17.0, Weight.GRAMS),                                    "Paris"));            parts.put(new PartKey("P3"),                      new PartData("Screw", "Blue",                                    new Weight(17.0, Weight.GRAMS),                                    "Rome"));            parts.put(new PartKey("P4"),                      new PartData("Screw", "Red",                                    new Weight(14.0, Weight.GRAMS),                                    "London"));            parts.put(new PartKey("P5"),                      new PartData("Cam", "Blue",                                    new Weight(12.0, Weight.GRAMS),                                    "Paris"));            parts.put(new PartKey("P6"),                      new PartData("Cog", "Red",                                    new Weight(19.0, Weight.GRAMS),                                    "London"));        }    }    /**     * Populate the supplier entities in the database.  If the supplier map is     * not empty, assume that this has already been done.     */    private void addSuppliers() {        Map suppliers = views.getSupplierMap();        if (suppliers.isEmpty()) {            System.out.println("Adding Suppliers");            suppliers.put(new SupplierKey("S1"),                          new SupplierData("Smith", 20, "London"));            suppliers.put(new SupplierKey("S2"),                          new SupplierData("Jones", 10, "Paris"));            suppliers.put(new SupplierKey("S3"),                          new SupplierData("Blake", 30, "Paris"));            suppliers.put(new SupplierKey("S4"),                          new SupplierData("Clark", 20, "London"));            suppliers.put(new SupplierKey("S5"),                          new SupplierData("Adams", 30, "Athens"));        }    }    /**     * Populate the shipment entities in the database.  If the shipment map     * is not empty, assume that this has already been done.     */    private void addShipments() {        Map shipments = views.getShipmentMap();        if (shipments.isEmpty()) {            System.out.println("Adding Shipments");            shipments.put(new ShipmentKey("P1", "S1"),                          new ShipmentData(300));            shipments.put(new ShipmentKey("P2", "S1"),                          new ShipmentData(200));            shipments.put(new ShipmentKey("P3", "S1"),                          new ShipmentData(400));            shipments.put(new ShipmentKey("P4", "S1"),                          new ShipmentData(200));            shipments.put(new ShipmentKey("P5", "S1"),                          new ShipmentData(100));            shipments.put(new ShipmentKey("P6", "S1"),                          new ShipmentData(100));            shipments.put(new ShipmentKey("P1", "S2"),                          new ShipmentData(300));            shipments.put(new ShipmentKey("P2", "S2"),                          new ShipmentData(400));            shipments.put(new ShipmentKey("P2", "S3"),                          new ShipmentData(200));            shipments.put(new ShipmentKey("P2", "S4"),                          new ShipmentData(200));            shipments.put(new ShipmentKey("P4", "S4"),                          new ShipmentData(300));            shipments.put(new ShipmentKey("P5", "S4"),                          new ShipmentData(400));        }    }    /**     * Print the key/value objects returned by an iterator of Map.Entry     * objects.     *     * <p><b> IMPORTANT: All database iterators must be closed to avoid     * serious database problems.  If the iterator is not closed, the     * underlying Berkeley DB cursor is not closed either. </b></p>     */    private void printEntries(String label, Iterator iterator) {        System.out.println("\n--- " + label + " ---");        try {            while (iterator.hasNext()) {                Map.Entry entry = (Map.Entry) iterator.next();                System.out.println(entry.getKey().toString());                System.out.println(entry.getValue().toString());            }        } finally {            // IMPORTANT: Use StoredIterator to close all database            // iterators.  If java.util.Iterator is in hand, you can safely            // close it by calling StoredIterator.close(Iterator).            StoredIterator.close(iterator);        }    }    /**     * Print the objects returned by an iterator of value objects.     *     * <p><b> IMPORTANT: All database iterators must be closed to avoid     * serious database problems.  If the iterator is not closed, the     * underlying Berkeley DB cursor is not closed either. </b></p>     */    private void printValues(String label, Iterator iterator) {        System.out.println("\n--- " + label + " ---");        try {            while (iterator.hasNext()) {                System.out.println(iterator.next().toString());            }        } finally {            // IMPORTANT: Use StoredIterator to close all database            // iterators.  If java.util.Iterator is in hand, you can safely            // close it by calling StoredIterator.close(Iterator).            StoredIterator.close(iterator);        }    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产亚洲综合在线| 国产中文字幕一区| 国产又黄又大久久| 老汉av免费一区二区三区| 日本亚洲视频在线| 热久久国产精品| 麻豆精品在线看| 极品少妇一区二区| 国产一区二区三区黄视频| 国产呦精品一区二区三区网站| 久久99久久99| 国内精品久久久久影院薰衣草| 国产一区91精品张津瑜| 国产精品一级在线| 成人免费视频一区二区| 99精品国产视频| 91福利视频在线| 欧美高清性hdvideosex| 9191国产精品| 26uuu色噜噜精品一区| 久久久久久久一区| 国产精品久久福利| 亚洲男人的天堂在线观看| 亚洲aaa精品| 国产最新精品精品你懂的| 粉嫩av一区二区三区在线播放| 99国产精品99久久久久久| 色哟哟精品一区| 日韩一区二区在线看片| 久久综合国产精品| 亚洲欧美日韩人成在线播放| 亚洲午夜精品久久久久久久久| 日韩va亚洲va欧美va久久| 精品亚洲国内自在自线福利| 国产宾馆实践打屁股91| 一本大道久久精品懂色aⅴ| 91精品欧美一区二区三区综合在| 精品免费国产二区三区| 成人欧美一区二区三区黑人麻豆| 一二三区精品福利视频| 久久se这里有精品| 色婷婷精品久久二区二区蜜臀av | 99视频超级精品| 欧美性高清videossexo| 欧美精品一区二区三区四区 | 欧美综合视频在线观看| 欧美一级片在线观看| 亚洲国产高清不卡| 香蕉久久一区二区不卡无毒影院| 精品一二三四在线| 在线亚洲+欧美+日本专区| 精品久久久久av影院| 亚洲精品国产品国语在线app| 男女男精品视频网| 色婷婷综合在线| 久久亚洲一级片| 亚洲狠狠爱一区二区三区| 国产美女精品人人做人人爽| 欧美性受xxxx| 中日韩免费视频中文字幕| 亚洲成a人片综合在线| 国产福利一区二区三区视频在线| 欧美揉bbbbb揉bbbbb| 国产精品乱码一区二区三区软件 | 一级精品视频在线观看宜春院 | 一本一道久久a久久精品 | 亚洲一区二区三区四区在线观看| 国产一区二区视频在线| 欧美性生活影院| 国产精品国产自产拍在线| 免费看黄色91| 欧美区视频在线观看| 国产精品久久久久精k8| 国产精品1区2区3区在线观看| 欧美日韩在线一区二区| 国产精品久久国产精麻豆99网站| 国产自产2019最新不卡| 91精品国产综合久久久久久久久久| 亚洲欧洲精品成人久久奇米网| 九九国产精品视频| 在线不卡一区二区| 一区二区三区四区在线播放| 粉嫩嫩av羞羞动漫久久久| 精品国产一区a| 蜜臀av一级做a爰片久久| 欧美日韩在线播放一区| 亚洲精品免费在线| 91热门视频在线观看| 国产女同互慰高潮91漫画| 久久成人麻豆午夜电影| 日韩精品自拍偷拍| 欧洲一区二区av| 亚洲欧洲国产专区| caoporn国产精品| 国产婷婷精品av在线| 国产福利一区在线观看| 国产色一区二区| 国产乱人伦偷精品视频不卡| 精品久久一区二区三区| 精品午夜久久福利影院| 精品久久久久久久人人人人传媒| 蜜臀91精品一区二区三区| 日韩一区二区免费高清| 理论片日本一区| 久久免费美女视频| 国产成人在线视频网址| 欧美韩国日本综合| 成人激情黄色小说| 国产精品久久久久久亚洲伦| av中文字幕亚洲| 一区二区三区在线免费播放| 在线国产电影不卡| 亚洲成av人片www| 91麻豆精品国产自产在线 | 国产一区美女在线| 久久影院午夜片一区| 国产精品99久久久久| 中文字幕人成不卡一区| 91视频在线观看免费| 亚洲综合丁香婷婷六月香| 欧美精品九九99久久| 久久国产精品露脸对白| 久久久精品欧美丰满| 91丨porny丨户外露出| 亚洲亚洲人成综合网络| 欧美精品123区| 国产美女久久久久| 亚洲视频一区在线观看| 欧美在线不卡一区| 日本欧美在线看| 欧美国产精品久久| 色爱区综合激月婷婷| 日韩va欧美va亚洲va久久| 国产欧美一区二区三区网站| 91丨porny丨在线| 蜜臀va亚洲va欧美va天堂| 国产精品午夜免费| 欧美巨大另类极品videosbest | 国产乱码精品一品二品| 国产精品久久久久久妇女6080| 在线观看免费视频综合| 麻豆精品久久久| 亚洲欧洲三级电影| 91精品在线免费| 成人av免费在线播放| 亚洲国产日韩综合久久精品| 精品国产免费视频| 91黄色激情网站| 国产在线乱码一区二区三区| 亚洲美女在线国产| 精品1区2区在线观看| 一本一道综合狠狠老| 国产一区二区三区日韩| 一区二区免费在线| 久久久综合网站| 欧美视频三区在线播放| 国产精品自在在线| 亚洲成人综合网站| 中文字幕不卡在线| 欧美放荡的少妇| 成人免费视频国产在线观看| 日韩精品亚洲一区二区三区免费| 国产拍欧美日韩视频二区| 欧美精品一级二级| 99久久亚洲一区二区三区青草| 毛片av中文字幕一区二区| 中文字幕一区二区三区不卡| 精品国产一区二区精华| 欧美日本在线播放| 一本色道久久综合精品竹菊| 国产毛片精品国产一区二区三区| 天天操天天综合网| 亚洲精品日韩专区silk| 国产精品素人一区二区| 久久在线观看免费| 日韩一区国产二区欧美三区| 欧美午夜视频网站| 一本大道久久精品懂色aⅴ| 国产a级毛片一区| 国模无码大尺度一区二区三区| 午夜精品久久久久久久99水蜜桃| 亚洲日本va午夜在线影院| 国产日韩精品一区二区三区| 欧美一级xxx| 在线成人av影院| 欧美男女性生活在线直播观看 | 国产精品对白交换视频| 久久亚洲欧美国产精品乐播| 日韩视频一区二区三区在线播放 | 91麻豆精品91久久久久久清纯| 欧美午夜电影网| 一本一道波多野结衣一区二区| k8久久久一区二区三区| 成人av在线网| 国产91精品免费| 国产乱人伦偷精品视频不卡| 国内精品国产三级国产a久久| 久99久精品视频免费观看| 蓝色福利精品导航| 精品一区二区在线视频|