1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml">
4  <head>
5    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6    <title>Database Usage Example</title>
7    <link rel="stylesheet" href="gettingStarted.css" type="text/css" />
8    <meta name="generator" content="DocBook XSL Stylesheets V1.62.4" />
9    <link rel="home" href="index.html" title="Getting Started with Berkeley DB" />
10    <link rel="up" href="DBEntry.html" title="Chapter��8.��Database Records" />
11    <link rel="previous" href="bindAPI.html" title="Using the BIND APIs" />
12    <link rel="next" href="Cursors.html" title="Chapter��9.��Using Cursors" />
13  </head>
14  <body>
15    <div class="navheader">
16      <table width="100%" summary="Navigation header">
17        <tr>
18          <th colspan="3" align="center">Database Usage Example</th>
19        </tr>
20        <tr>
21          <td width="20%" align="left"><a accesskey="p" href="bindAPI.html">Prev</a>��</td>
22          <th width="60%" align="center">Chapter��8.��Database Records</th>
23          <td width="20%" align="right">��<a accesskey="n" href="Cursors.html">Next</a></td>
24        </tr>
25      </table>
26      <hr />
27    </div>
28    <div class="sect1" lang="en" xml:lang="en">
29      <div class="titlepage">
30        <div>
31          <div>
32            <h2 class="title" style="clear: both"><a id="dbtJavaUsage"></a>Database Usage Example</h2>
33          </div>
34        </div>
35        <div></div>
36      </div>
37      <p>
38        In <a href="CoreJavaUsage.html#MyDb">MyDbs Class</a> we created 
39        a class that opens and closes databases for us.
40        We now make use of that class to load inventory data into
41        two databases that we will use for our inventory system.
42    </p>
43      <p>
44        Again, remember that you can find the complete implementation for these functions
45        in:
46    </p>
47      <pre class="programlisting"><span class="emphasis"><em>DB_INSTALL</em></span>/examples_java/db/GettingStarted</pre>
48      <p>
49        where <tt class="literal"><span class="emphasis"><em>DB_INSTALL</em></span></tt> is the location where you
50        placed your DB distribution.
51    </p>
52      <p>Note that in this example, we are going to save two types of
53    information. First there are a series of inventory records that identify
54    information about some food items (fruits, vegetables, and desserts).
55    These records identify particulars about each item such as the vendor that
56    the item can be obtained from, how much the vendor has in stock, the price
57    per unit, and so forth.</p>
58      <p>
59        We also want to manage vendor contact information, such as the
60        vendor's address and phone number, the sales representative's name
61        and his phone number, and so forth.
62    </p>
63      <div class="example">
64        <a id="inventoryjava"></a>
65        <p class="title">
66          <b>Example 8.1 Inventory.java</b>
67        </p>
68        <p>
69      All Inventory data is encapsulated in an instance of the following
70      class. Note that because this class is not serializable, we need a
71      custom tuple binding in order to place it on a <tt class="classname">DatabaseEntry</tt>
72      object. Because the <tt class="classname">TupleInput</tt> and
73      <tt class="classname">TupleOutput</tt> classes used by custom tuple bindings
74      support Java numerical types and not Java numerical classes, we use
75      <tt class="literal">int</tt> and <tt class="literal">float</tt> here instead of the
76      corresponding <tt class="classname">Integer</tt> and <tt class="classname">Float</tt>
77      classes.
78      
79      </p>
80        <a id="java_dbt16"></a>
81        <pre class="programlisting">// File Inventory.java
82package db.GettingStarted;
83
84public class Inventory {
85
86    private String sku;
87    private String itemName;
88    private String category;
89    private String vendor;
90    private int vendorInventory;
91    private float vendorPrice;
92
93    public void setSku(String data) {
94            sku = data;
95    }
96
97    public void setItemName(String data) {
98            itemName = data;
99    }
100
101    public void setCategory(String data) {
102            category = data;
103    }
104
105    public void setVendorInventory(int data) {
106            vendorInventory = data;
107    }
108
109    public void setVendor(String data) {
110            vendor = data;
111    }
112
113    public void setVendorPrice(float data) {
114            vendorPrice = data;
115    }
116
117    public String getSku() { return sku; }
118    public String getItemName() { return itemName; }
119    public String getCategory() { return category; }
120    public int getVendorInventory() { return vendorInventory; }
121    public String getVendor() { return vendor; }
122    public float getVendorPrice() { return vendorPrice; }
123
124} </pre>
125      </div>
126      <div class="example">
127        <a id="vendorjava"></a>
128        <p class="title">
129          <b>Example 8.2 Vendor.java</b>
130        </p>
131        <p>
132        The data for vendor records are stored in instances of the following
133        class.  Notice that we are using serialization with this class for no
134        other reason than to demonstrate serializing a class instance.
135      </p>
136        <a id="java_dbt17"></a>
137        <pre class="programlisting">// File Vendor.java
138package db.GettingStarted;
139
140import java.io.Serializable;
141
142public class Vendor implements Serializable {
143
144    private String repName;
145    private String address;
146    private String city;
147    private String state;
148    private String zipcode;
149    private String bizPhoneNumber;
150    private String repPhoneNumber;
151    private String vendor;
152
153    public void setRepName(String data) {
154        repName = data;
155    }
156
157    public void setAddress(String data) {
158        address = data;
159    }
160
161    public void setCity(String data) {
162        city = data;
163    }
164
165    public void setState(String data) {
166        state = data;
167    }
168
169    public void setZipcode(String data) {
170        zipcode = data;
171    }
172
173    public void setBusinessPhoneNumber(String data) {
174        bizPhoneNumber = data;
175    }
176
177    public void setRepPhoneNumber(String data) {
178        repPhoneNumber = data;
179    }
180
181    public void setVendorName(String data) {
182        vendor = data;
183    }
184
185    ...
186    // Corresponding getter methods omitted for brevity.
187    // See examples/je/gettingStarted/Vendor.java
188    // for a complete implementation of this class.
189
190} </pre>
191      </div>
192      <p>
193        Because we will not be using serialization to convert our
194        <tt class="classname">Inventory</tt> objects to a <tt class="classname">DatabaseEntry</tt>
195        object, we need a custom tuple binding:
196    </p>
197      <div class="example">
198        <a id="InventoryJavaBinding"></a>
199        <p class="title">
200          <b>Example 8.3 InventoryBinding.java</b>
201        </p>
202        <a id="java_dbt18"></a>
203        <pre class="programlisting">// File InventoryBinding.java
204package db.GettingStarted;
205
206import com.sleepycat.bind.tuple.TupleBinding;
207import com.sleepycat.bind.tuple.TupleInput;
208import com.sleepycat.bind.tuple.TupleOutput;
209
210public class InventoryBinding extends TupleBinding {
211
212    // Implement this abstract method. Used to convert
213    // a DatabaseEntry to an Inventory object.
214    public Object entryToObject(TupleInput ti) {
215
216        String sku = ti.readString();
217        String itemName = ti.readString();
218        String category = ti.readString();
219        String vendor = ti.readString();
220        int vendorInventory = ti.readInt();
221        float vendorPrice = ti.readFloat();
222
223        Inventory inventory = new Inventory();
224        inventory.setSku(sku);
225        inventory.setItemName(itemName);
226        inventory.setCategory(category);
227        inventory.setVendor(vendor);
228        inventory.setVendorInventory(vendorInventory);
229        inventory.setVendorPrice(vendorPrice);
230
231        return inventory;
232    }
233
234    // Implement this abstract method. Used to convert a
235    // Inventory object to a DatabaseEntry object.
236    public void objectToEntry(Object object, TupleOutput to) {
237
238        Inventory inventory = (Inventory)object;
239
240        to.writeString(inventory.getSku());
241        to.writeString(inventory.getItemName());
242        to.writeString(inventory.getCategory());
243        to.writeString(inventory.getVendor());
244        to.writeInt(inventory.getVendorInventory());
245        to.writeFloat(inventory.getVendorPrice());
246    }
247} </pre>
248      </div>
249      <p>
250        In order to store the data identified above, we write the
251        <tt class="classname">ExampleDatabaseLoad</tt> application. This application
252        loads the inventory and vendor databases for you.
253    </p>
254      <p>
255        Inventory information is stored in a <tt class="classname">Database</tt>
256        dedicated for that purpose. The key for each such record is a product
257        SKU.  The inventory data stored in this database are objects of the
258        <tt class="classname">Inventory</tt> class (see <a href="dbtJavaUsage.html#inventoryjava">Inventory.java</a> for more information).
259        <tt class="classname">ExampleDatabaseLoad</tt> loads the inventory database
260        as follows:
261    </p>
262      <div class="orderedlist">
263        <ol type="1">
264          <li>
265            <p>
266            Reads the inventory data from a flat text file prepared in
267            advance for this purpose.
268        </p>
269          </li>
270          <li>
271            <p>
272            Uses <tt class="classname">java.lang.String</tt> to create a key based
273            on the item's SKU.
274        </p>
275          </li>
276          <li>
277            <p>Uses an <tt class="classname">Inventory</tt> class instance for the
278        record data. This object is stored on a <tt class="classname">DatabaseEntry</tt>
279        object using <tt class="classname">InventoryBinding</tt>, a custom tuple
280        binding that we implemented above.</p>
281          </li>
282          <li>
283            <p>Saves each record to the inventory database.</p>
284          </li>
285        </ol>
286      </div>
287      <p>Vendor information is also stored in a <tt class="classname">Database</tt>
288    dedicated for that purpose.  The vendor data stored in this database are objects of the
289    <tt class="classname">Vendor</tt> class (see <a href="dbtJavaUsage.html#vendorjava">Vendor.java</a> for more information). To load this
290    <tt class="classname">Database</tt>, <tt class="classname">ExampleDatabaseLoad</tt>
291    does the following:</p>
292      <div class="orderedlist">
293        <ol type="1">
294          <li>
295            <p>Reads the vendor data from a flat text file prepared in advance
296        for this purpose.</p>
297          </li>
298          <li>
299            <p>Uses the vendor's name as the record's key.</p>
300          </li>
301          <li>
302            <p>Uses a <tt class="classname">Vendor</tt> class instance for the
303        record data. This object is stored on a <tt class="classname">DatabaseEntry</tt>
304        object using <tt class="classname">com.sleepycat.bind.serial.SerialBinding</tt>.</p>
305          </li>
306        </ol>
307      </div>
308      <div class="example">
309        <a id="dbsStoredClass"></a>
310        <p class="title">
311          <b>Example 8.4 Stored Class Catalog Management with MyDbs</b>
312        </p>
313        <p>
314            Before we can write <tt class="classname">ExampleDatabaseLoad</tt>, we need to update 
315            <tt class="filename">MyDbs.java</tt> to support the class catalogs that we need for this application.
316        </p>
317        <p>
318            To do this, we start by importing an additional class to support stored class catalogs:
319        </p>
320        <a id="java_dbt19"></a>
321        <pre class="programlisting">// File: MyDbs.java
322package db.GettingStarted;
323                                                                                                                                  
324<b class="userinput"><tt>import com.sleepycat.bind.serial.StoredClassCatalog;</tt></b>
325
326import com.sleepycat.db.Database;
327import com.sleepycat.db.DatabaseConfig;
328import com.sleepycat.db.DatabaseException;
329import com.sleepycat.db.DatabaseType;
330
331import java.io.FileNotFoundException; </pre>
332        <p>
333    We also need to add two additional private data members to this class. One
334    supports the database used for the class catalog, and the other is used as a
335    handle for the class catalog itself.
336</p>
337        <a id="java_dbt20"></a>
338        <pre class="programlisting">public class MyDbs {
339
340    // The databases that our application uses
341    private Database vendorDb = null;
342    private Database inventoryDb = null;
343    <b class="userinput"><tt>private Database classCatalogDb = null;
344
345    // Needed for object serialization
346    private StoredClassCatalog classCatalog;</tt></b>
347
348    private String vendordb = "VendorDB.db";
349    private String inventorydb = "InventoryDB.db";
350    <b class="userinput"><tt>private String classcatalogdb = "ClassCatalogDB.db";</tt></b>
351
352    // Our constructor does nothing
353    public MyDbs() {} </pre>
354        <p>
355        Next we need to update the <tt class="methodname">MyDbs.setup()</tt> method 
356        to open the class catalog database and create the class catalog.
357    </p>
358        <a id="java_dbt21"></a>
359        <pre class="programlisting">    // The setup() method opens all our databases
360    // for us.
361    public void setup(String databasesHome)
362        throws DatabaseException {
363
364        DatabaseConfig myDbConfig = new DatabaseConfig();
365
366        ...
367        // Database configuration omitted for brevity
368        ...
369
370        // Now open, or create and open, our databases
371        // Open the vendors and inventory databases
372        try {
373            vendordb = databasesHome + "/" + vendordb;
374            vendorDb = new Database(vendordb,
375                                    null,
376                                    myDbConfig);
377
378            inventorydb = databasesHome + "/" + inventorydb;
379            inventoryDb = new Database(inventorydb,
380                                        null,
381                                        myDbConfig);
382
383            <b class="userinput"><tt>// Open the class catalog db. This is used to
384            // optimize class serialization.
385            classcatalogdb = databasesHome + "/" + classcatalogdb;
386            classCatalogDb = new Database(classcatalogdb,
387                                          null,
388                                          myDbConfig); </tt></b>
389
390        } catch(FileNotFoundException fnfe) {
391            System.err.println("MyDbs: " + fnfe.toString());
392            System.exit(-1);
393        }
394    } </pre>
395        <p>
396        Finally we need a getter method to return the class catalog. Note that we do not provide a getter for
397        the catalog database itself ��� our application has no need for that.
398    </p>
399        <p>
400        We also update our <tt class="methodname">close()</tt> to close our class catalog.
401    </p>
402        <a id="java_dbt22"></a>
403        <pre class="programlisting">   // getter methods
404    public Database getVendorDB() {
405        return vendorDb;
406    }
407
408    public Database getInventoryDB() {
409        return inventoryDb;
410    }
411
412    <b class="userinput"><tt>public StoredClassCatalog getClassCatalog() {
413        return classCatalog;
414    }</tt></b>
415</pre>
416        <p>
417    Finally, we need our <tt class="methodname">close()</tt> method:
418</p>
419        <a id="java_dbt23"></a>
420        <pre class="programlisting">
421
422    // Close the databases
423    public void close() {
424        try {
425            if (vendorDb != null) {
426                vendorDb.close();
427            }
428
429            if (inventoryDb != null) {
430                inventoryDb.close();
431            }
432
433            <b class="userinput"><tt>if (classCatalogDb != null) {
434                classCatalogDb.close();
435            }</tt></b>
436        } catch(DatabaseException dbe) {
437            System.err.println("Error closing MyDbs: " +
438                                dbe.toString());
439            System.exit(-1);
440        }
441    }
442} </pre>
443      </div>
444      <p>
445        So far we have identified the data that we want to store in our
446        databases and how we will convert that data in and out of
447        <tt class="classname">DatabaseEntry</tt> objects for database storage. We
448        have also updated <tt class="classname">MyDbs</tt> to manage our databases
449        for us. Now we write <tt class="classname">ExampleDatabaseLoad</tt> to
450        actually put the inventory and vendor data into their respective
451        databases. Because of the work that we have done so far, this
452        application is actually fairly simple to write.
453    </p>
454      <div class="example">
455        <a id="EDL"></a>
456        <p class="title">
457          <b>Example 8.5 ExampleDatabaseLoad.java</b>
458        </p>
459        <p>First we need the usual series of import statements:</p>
460        <a id="java_dbt24"></a>
461        <pre class="programlisting">// File: ExampleDatabaseLoad.java
462package db.GettingStarted;
463                                                                                                                                       
464import java.io.BufferedReader;
465import java.io.File;
466import java.io.FileInputStream;
467import java.io.FileNotFoundException;
468import java.io.IOException;
469import java.io.InputStreamReader;
470import java.util.ArrayList;
471import java.util.List;
472
473import com.sleepycat.bind.EntryBinding;
474import com.sleepycat.bind.serial.SerialBinding;
475import com.sleepycat.bind.tuple.TupleBinding;
476import com.sleepycat.db.DatabaseEntry;
477import com.sleepycat.db.DatabaseException; </pre>
478        <p>Next comes the class declaration and the private data members that
479      we need for this class. Most of these are setting up default values for
480      the program.</p>
481        <p>Note that two <tt class="classname">DatabaseEntry</tt> objects are
482      instantiated here. We will reuse these for every database operation that
483      this program performs. Also a <tt class="classname">MyDbEnv</tt> object is
484      instantiated here. We can do this because its constructor never throws
485      an exception. See <a href="dbtJavaUsage.html#dbsStoredClass">Stored Class Catalog Management with MyDbs</a> for
486      its implementation details.</p>
487        <p>Finally, the <tt class="filename">inventory.txt</tt> and
488      <tt class="filename">vendors.txt</tt> file can be found in the GettingStarted
489      examples directory along with the classes described in this extended
490      example.</p>
491        <a id="java_dbt25"></a>
492        <pre class="programlisting">public class ExampleDatabaseLoad {
493
494    private static String myDbsPath = "./";
495    private static File inventoryFile = new File("./inventory.txt");
496    private static File vendorsFile = new File("./vendors.txt");
497
498    // DatabaseEntries used for loading records
499    private static DatabaseEntry theKey = new DatabaseEntry();
500    private static DatabaseEntry theData = new DatabaseEntry();
501
502    // Encapsulates the databases.
503    private static MyDbs myDbs = new MyDbs(); </pre>
504        <p>
505            Next comes the <tt class="methodname">usage()</tt> and
506            <tt class="methodname">main()</tt> methods. Notice the exception handling
507            in the <tt class="methodname">main()</tt> method. This is the only place in the application where we
508            catch exceptions. For this reason, we must catch
509            <tt class="classname">DatabaseException</tt> which is thrown by the
510            <tt class="literal">com.sleepycat.db.*</tt> classes.
511      </p>
512        <p>Also notice the call to <tt class="methodname">MyDbs.close()</tt>
513      in the <tt class="literal">finally</tt> block. This is the only place in the
514      application where <tt class="methodname">MyDbs.close()</tt> is called.
515      <tt class="methodname">MyDbs.close()</tt> is responsible for closing
516      all open <tt class="classname">Database</tt>
517      handles for you.</p>
518        <a id="java_dbt26"></a>
519        <pre class="programlisting">    private static void usage() {
520        System.out.println("ExampleDatabaseLoad [-h &lt;database home&gt;]");
521        System.out.println("      [-s &lt;selections file&gt;] [-v &lt;vendors file&gt;]");
522        System.exit(-1);
523    }
524
525    public static void main(String args[]) {
526        ExampleDatabaseLoad edl = new ExampleDatabaseLoad();
527        try {
528            edl.run(args);
529        } catch (DatabaseException dbe) {
530            System.err.println("ExampleDatabaseLoad: " + dbe.toString());
531            dbe.printStackTrace();
532        } catch (Exception e) {
533            System.out.println("Exception: " + e.toString());
534            e.printStackTrace();
535        } finally {
536            myDbs.close();
537        }
538        System.out.println("All done.");
539    } </pre>
540        <p>Next we write the <tt class="methodname">ExampleDatabaseLoad.run()</tt>
541      method. This method is responsible for initializing all objects. 
542      Because our environment and databases are all opened using the 
543      <tt class="methodname">MyDbs.setup()</tt> method, <tt class="methodname">ExampleDatabaseLoad.run()</tt>
544      method is only responsible for calling <tt class="methodname">MyDbs.setup()</tt> and then calling 
545      the <tt class="classname">ExampleDatabaseLoad</tt> methods that actually load the databases. 
546      </p>
547        <a id="java_dbt27"></a>
548        <pre class="programlisting">    private void run(String args[]) throws DatabaseException {
549        // Parse the arguments list
550        parseArgs(args);
551
552        myDbs.setup(myDbsPath); // path to the environment home
553
554        System.out.println("loading vendors db.");
555        loadVendorsDb();
556        System.out.println("loading inventory db.");
557        loadInventoryDb();
558    } </pre>
559        <p>This next method loads the vendor database. This method
560      uses serialization to convert the <tt class="classname">Vendor</tt> object
561      to a <tt class="classname">DatabaseEntry</tt> object.</p>
562        <a id="java_dbt28"></a>
563        <pre class="programlisting">   private void loadVendorsDb() 
564            throws DatabaseException {
565
566        // loadFile opens a flat-text file that contains our data
567        // and loads it into a list for us to work with. The integer
568        // parameter represents the number of fields expected in the
569        // file.
570        List vendors = loadFile(vendorsFile, 8);
571
572        // Now load the data into the database. The vendor's name is the
573        // key, and the data is a Vendor class object.
574
575        // Need a serial binding for the data
576        EntryBinding dataBinding =
577            new SerialBinding(myDbs.getClassCatalog(), Vendor.class);
578
579        for (int i = 0; i &lt; vendors.size(); i++) {
580            String[] sArray = (String[])vendors.get(i);
581            Vendor theVendor = new Vendor();
582            theVendor.setVendorName(sArray[0]);
583            theVendor.setAddress(sArray[1]);
584            theVendor.setCity(sArray[2]);
585            theVendor.setState(sArray[3]);
586            theVendor.setZipcode(sArray[4]);
587            theVendor.setBusinessPhoneNumber(sArray[5]);
588            theVendor.setRepName(sArray[6]);
589            theVendor.setRepPhoneNumber(sArray[7]);
590
591            // The key is the vendor's name.
592            // ASSUMES THE VENDOR'S NAME IS UNIQUE!
593            String vendorName = theVendor.getVendorName();
594            try {
595                theKey = new DatabaseEntry(vendorName.getBytes("UTF-8"));
596            } catch (IOException willNeverOccur) {}
597
598            // Convert the Vendor object to a DatabaseEntry object
599            // using our SerialBinding
600            dataBinding.objectToEntry(theVendor, theData);
601
602            // Put it in the database.
603            myDbs.getVendorDB().put(null, theKey, theData);
604        }
605    } </pre>
606        <p>Now load the inventory database. This method uses our
607      custom tuple binding (see <a href="dbtJavaUsage.html#InventoryJavaBinding">InventoryBinding.java</a>) to convert the <tt class="classname">Inventory</tt>
608      object to a <tt class="classname">DatabaseEntry</tt> object.</p>
609        <a id="java_dbt29"></a>
610        <pre class="programlisting">    private void loadInventoryDb() 
611        throws DatabaseException {
612
613        // loadFile opens a flat-text file that contains our data
614        // and loads it into a list for us to work with. The integer
615        // parameter represents the number of fields expected in the
616        // file.
617        List inventoryArray = loadFile(inventoryFile, 6);
618
619        // Now load the data into the database. The item's sku is the
620        // key, and the data is an Inventory class object.
621
622        // Need a tuple binding for the Inventory class.
623        TupleBinding inventoryBinding = new InventoryBinding();
624
625        for (int i = 0; i &lt; inventoryArray.size(); i++) {
626            String[] sArray = (String[])inventoryArray.get(i);
627            String sku = sArray[1];
628            try {
629                theKey = new DatabaseEntry(sku.getBytes("UTF-8"));
630            } catch (IOException willNeverOccur) {}
631
632            Inventory theInventory = new Inventory();
633            theInventory.setItemName(sArray[0]);
634            theInventory.setSku(sArray[1]);
635            Float price = new Float(sArray[2]);
636            theInventory.setVendorPrice(price.floatValue());
637            Integer vInventory = new Integer(sArray[3]);
638            theInventory.setVendorInventory(vInventory.intValue());
639            theInventory.setCategory(sArray[4]);
640            theInventory.setVendor(sArray[5]);
641
642            // Place the Vendor object on the DatabaseEntry object using 
643            // our the tuple binding we implemented in 
644            // InventoryBinding.java
645            inventoryBinding.objectToEntry(theInventory, theData);
646
647            // Put it in the database. Note that this causes our 
648            // secondary database to be automatically updated for us.
649            myDbs.getInventoryDB().put(null, theKey, theData);
650        }
651    }</pre>
652        <p>
653        The remainder of this application provides utility methods to 
654        read a flat text file into an array of strings and parse the
655        command line options: 
656      </p>
657        <a id="java_dbt30"></a>
658        <pre class="programlisting">    private static void parseArgs(String args[]) {
659        // Implementation omitted for brevity.
660    }
661
662    private List loadFile(File theFile, int numFields) {
663        List records = new ArrayList();
664        // Implementation omitted for brevity.
665        return records;
666    }
667
668    protected ExampleDatabaseLoad() {}
669} </pre>
670        <p>
671        From the perspective of this document, these
672        things are relatively uninteresting. You can see how they are
673        implemented by looking at <tt class="filename">ExampleDatabaseLoad.java</tt>
674        in:
675      </p>
676        <pre class="programlisting"><span class="emphasis"><em>DB_INSTALL</em></span>/examples_java/db/GettingStarted</pre>
677        <p>
678        where <tt class="literal"><span class="emphasis"><em>DB_INSTALL</em></span></tt> is the location where you
679        placed your DB distribution.
680    </p>
681      </div>
682    </div>
683    <div class="navfooter">
684      <hr />
685      <table width="100%" summary="Navigation footer">
686        <tr>
687          <td width="40%" align="left"><a accesskey="p" href="bindAPI.html">Prev</a>��</td>
688          <td width="20%" align="center">
689            <a accesskey="u" href="DBEntry.html">Up</a>
690          </td>
691          <td width="40%" align="right">��<a accesskey="n" href="Cursors.html">Next</a></td>
692        </tr>
693        <tr>
694          <td width="40%" align="left" valign="top">Using the BIND APIs��</td>
695          <td width="20%" align="center">
696            <a accesskey="h" href="index.html">Home</a>
697          </td>
698          <td width="40%" align="right" valign="top">��Chapter��9.��Using Cursors</td>
699        </tr>
700      </table>
701    </div>
702  </body>
703</html>
704