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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sample.java

?? 關于Berkelay數據庫的共享源碼
?? 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:53 bostic Exp $ */package collections.ship.basic;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.basic.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.     */    private class PrintDatabase implements TransactionWorker {        public void doWork()            throws Exception {            printEntries("Parts",			 views.getPartEntrySet().iterator());            printEntries("Suppliers",			 views.getSupplierEntrySet().iterator());            printEntries("Shipments",			 views.getShipmentEntrySet().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);        }    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久99久久99| 欧美videos大乳护士334| 日韩区在线观看| 成人免费一区二区三区视频| 美女视频一区在线观看| 在线观看一区不卡| 国产欧美精品一区二区三区四区 | 欧美丝袜丝交足nylons| 久久久久久久久一| 亚洲mv在线观看| 91麻豆福利精品推荐| 国产日韩欧美麻豆| 久久精品国产网站| 91精品视频网| 亚洲va欧美va国产va天堂影院| bt7086福利一区国产| 久久久www免费人成精品| 久久99精品国产麻豆婷婷| 欧美三级资源在线| 亚洲精品菠萝久久久久久久| 99热精品国产| 亚洲欧美在线aaa| 成人免费视频视频在线观看免费| 久久综合给合久久狠狠狠97色69| 精品写真视频在线观看| 欧美一卡在线观看| 日韩福利视频导航| 69p69国产精品| 奇米在线7777在线精品| 欧美日韩国产在线播放网站| 亚洲午夜三级在线| 欧美日韩国产成人在线免费| 亚洲妇女屁股眼交7| 欧美中文字幕一区二区三区亚洲| 亚洲一区在线视频观看| 欧美视频一区二区在线观看| 亚洲国产精品嫩草影院| 欧美精品vⅰdeose4hd| 日本欧美韩国一区三区| 日韩欧美久久久| 国产精品中文有码| 国产精品久久久久影院亚瑟| 97久久久精品综合88久久| 亚洲乱码国产乱码精品精98午夜| 日本精品一区二区三区高清| 亚洲福利电影网| 69堂精品视频| 国产激情视频一区二区三区欧美 | 欧美极品少妇xxxxⅹ高跟鞋| 国产 日韩 欧美大片| 亚洲视频香蕉人妖| 欧美精品粉嫩高潮一区二区| 精品在线一区二区三区| 中文字幕中文字幕一区二区| 日本道免费精品一区二区三区| 亚洲va天堂va国产va久| 精品国产欧美一区二区| 不卡的看片网站| 日韩av一区二区在线影视| 欧美va亚洲va| 成人午夜精品在线| 亚洲高清一区二区三区| 国产日韩欧美综合一区| 在线视频亚洲一区| 精品一区二区三区在线视频| 国产精品久久久久久户外露出| 欧美色网一区二区| 国产一区在线观看视频| 一区二区三国产精华液| 久久欧美中文字幕| 欧美午夜精品久久久久久孕妇| 韩国中文字幕2020精品| 亚洲一级二级三级在线免费观看| 精品国产污网站| 日本精品裸体写真集在线观看| 国产一区二三区| 亚洲午夜精品在线| 久久精品一区八戒影视| 7777精品伊人久久久大香线蕉| 成人av网站在线观看免费| 美国三级日本三级久久99| 亚洲欧美日本在线| 久久蜜桃av一区二区天堂| 欧美揉bbbbb揉bbbbb| 成人在线视频一区二区| 精品一区二区三区久久久| 亚洲国产aⅴ天堂久久| 国产精品你懂的| 久久久精品国产免大香伊 | 99久久精品免费观看| 奇米综合一区二区三区精品视频| 亚洲乱码国产乱码精品精的特点| 国产午夜精品久久久久久免费视| 在线电影一区二区三区| 欧美在线综合视频| av亚洲精华国产精华| 国产成人啪免费观看软件| 蜜桃视频一区二区三区| 日韩成人免费看| 亚洲成av人片一区二区三区 | 国产三级一区二区三区| 欧美草草影院在线视频| 欧美一区二区成人6969| 欧美人妖巨大在线| 欧美日韩综合色| 91行情网站电视在线观看高清版| 成人av电影在线观看| 成人白浆超碰人人人人| 粉嫩av亚洲一区二区图片| 国产91清纯白嫩初高中在线观看 | 国产一区二区三区精品欧美日韩一区二区三区 | 99久久婷婷国产| 成人免费视频免费观看| 国产69精品久久99不卡| 岛国av在线一区| 成人美女视频在线观看| av一区二区三区黑人| 91在线视频在线| 欧洲日韩一区二区三区| 欧美亚洲一区二区三区四区| 欧美日韩一区二区三区不卡| 欧美日韩精品系列| 欧美成人伊人久久综合网| 久久久九九九九| 亚洲国产激情av| 一区二区三区资源| 污片在线观看一区二区| 美腿丝袜一区二区三区| 国产精品系列在线播放| 成人禁用看黄a在线| 91黄视频在线| 日韩精品资源二区在线| 国产色综合久久| 亚洲另类在线视频| 婷婷国产在线综合| 久久99久久精品| 99久久精品一区二区| 欧美午夜视频网站| 精品理论电影在线| 国产精品动漫网站| 午夜欧美大尺度福利影院在线看| 九九精品视频在线看| av日韩在线网站| 欧美一区二视频| 中文一区二区完整视频在线观看| 亚洲精选免费视频| 免费在线观看一区| 懂色中文一区二区在线播放| 欧美日韩中文字幕一区| 久久毛片高清国产| 亚洲午夜三级在线| 国产成人欧美日韩在线电影| 欧美四级电影在线观看| 国产欧美久久久精品影院| 亚洲成人在线网站| 成人动漫精品一区二区| 91精品国产一区二区三区蜜臀| 国产精品伦一区| 另类小说视频一区二区| 在线免费视频一区二区| 久久久99精品免费观看| 午夜免费久久看| 99精品国产视频| 久久精品亚洲一区二区三区浴池 | 福利电影一区二区| 欧美夫妻性生活| 亚洲素人一区二区| 国产一区91精品张津瑜| 欧美性色黄大片| 亚洲图片激情小说| 国产乱子轮精品视频| 正在播放一区二区| 一区二区激情视频| 91在线小视频| 中文字幕日韩精品一区| 久久99国内精品| 日韩一区二区三区av| 亚洲国产欧美日韩另类综合 | 亚洲小少妇裸体bbw| 99久久久免费精品国产一区二区 | 久久精品亚洲一区二区三区浴池| 日本一道高清亚洲日美韩| 欧洲一区二区三区在线| 亚洲欧美日韩国产综合在线 | 一区二区三区免费在线观看| 不卡视频一二三| 国产精品拍天天在线| 国产91精品一区二区麻豆亚洲| 精品理论电影在线| 黄色资源网久久资源365| 日韩三区在线观看| 奇米精品一区二区三区在线观看 | 亚洲午夜久久久久久久久电影院 | 欧美性三三影院| 亚洲午夜在线观看视频在线| 欧美色视频在线观看| 亚洲成人777| 日韩一区二区在线播放| 日本成人在线电影网| 日韩精品专区在线影院观看|