<p>How do I write the getDB() function and use it properly?</p>

<p>Here is a code snippet of my App Object:</p>

<pre><code>public class MyApp extends UiApplication {

    private static PersistentObject m_oStore;
    private static MyBigObjectOfStorage m_oDB;

    static {
        store = PersistentStore.getPersistentObject(0xa1a569278238dad2L);
    }

    public static void main(String[] args) {
        MyApp theApp = new MyApp();
        theApp.enterEventDispatcher();
    }
    public MyApp() {
        pushScreen(new MyMainScreen());
    }

    // Is this correct?  Will it return a copy of m_oDB or a reference of m_oDB?
    public MyBigObjectOfStorage getDB() {
        return m_oDB;  // returns a reference
    }

}
</code></pre>

```
```
public MyBigObjectOfStorage getDB() {
    Object o = store.getContents();
    if ( o instanceof MyBigObjectOfStorage ) {
        return (MyBigObjectOfStorage) o;
    } else {
        return null;
    }
}
```
```