Esempio di codice: eliminazione di dati dalla tabella

/*
 * DeleteData.java
 *
 * Research In Motion Limited proprietary and confidential
 * Copyright Research In Motion Limited, 2010
 */
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.database.*;
import net.rim.device.api.io.*;
public class DeleteData extends UiApplication
{
    public static void main(String[] args)
    {
        DeleteData theApp = new DeleteData();
        theApp.enterEventDispatcher();
    }
    public DeleteData()
    {
        pushScreen(new DeleteDataScreen());
    }   
}
class DeleteDataScreen extends MainScreen
{
    Database d;
    public DeleteDataScreen()
    {
        LabelField title = new LabelField("SQLite Delete Database Data",
                                           LabelField.ELLIPSIS |
                                           LabelField.USE_ALL_WIDTH);
        setTitle(title);
        add(new RichTextField("Attempting to delete data from " + 
                              "MyTestDatabase.db on the SDCard."));
        try
        {
            URI myURI = URI.create("file:///SDCard/Databases/SQLite_Guide/" +
                                   "MyTestDatabase.db"); 
            d = DatabaseFactory.open(myURI);
            Statement st = d.createStatement("DELETE People");
            st.prepare();
            st.execute();
            st.close();
            d.close();
        }
        catch ( Exception e ) 
        {         
            System.out.println( e.getMessage() );
            e.printStackTrace();
        }
    }
}

Le informazioni sono state utili? Inviateci i vostri commenti.