Using SQLite in Codename One Application
<p>I have a working sqlite db which I have place in my /src folder.
I then went onto the Codename One website and followed their doc example </p>

<pre><code>    Database db = null;
    Cursor cur = null;
    try {
        db = Display.getInstance().openOrCreate("MyDb.db");
        if(query.getText().startsWith("select")) {
            cur = db.executeQuery(query.getText());
            int columns = cur.getColumnCount();
            frmMain.removeAll();
            if(columns &gt; 0) {
                boolean next = cur.next();
                if(next) {
                    ArrayList&lt;String[]&gt; data = new ArrayList&lt;&gt;();
                    String[] columnNames = new String[columns];
                    for(int iter = 0 ; iter &lt; columns ; iter++) {
                        columnNames[iter] = cur.getColumnName(iter);
                    }
                    while(next) {
                        Row currentRow = cur.getRow();
                        String[] currentRowArray = new String[columns];
                        for(int iter = 0 ; iter &lt; columns ; iter++) {
                            currentRowArray[iter] = currentRow.getString(iter);
                        }
                        data.add(currentRowArray);
                        next = cur.next();
                    }
                    Object[][] arr = new Object[data.size()][];
                    data.toArray(arr);
                    frmMain.add(BorderLayout.CENTER, new Table(new DefaultTableModel(columnNames, arr)));
                } else {
                    frmMain.add(BorderLayout.CENTER, "Query returned no results");
                }
            } else {
                frmMain.add(BorderLayout.CENTER, "Query returned no results");
            }
        } else {
            db.execute(query.getText());
            frmMain.add(BorderLayout.CENTER, "Query completed successfully");
        }
        frmMain.revalidate();
    } catch(IOException err) {

        frmMain.removeAll();
        frmMain.add(BorderLayout.CENTER, "Error: " + err);
        frmMain.revalidate();
    } finally {
        Util.cleanup(db);
        Util.cleanup(cur);
    }
</code></pre>

<p>However when I run the example and try and execute a simple select query I get this error ...</p>

<pre><code>java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (no such table: MyTable)
</code></pre>

<ul>
<li>So I have added the DB</li>
<li>I have used the 'openOrCreate' statement</li>
</ul>

<p>Have I missed a step?</p>

<p>Thanks</p>