Suddenly all database functions fail on my app
<p>Suddenly all database functions don' t work on my app. The error is always <code>NullPointer exception</code> and points to deferent methods from <code>dataObjectsProvider class</code>, depended which funcion used. For e.g when trying to insert values on <code>CreateDataObjectsMethod</code>, when trying to empty/delete the database to <code>deleteObjectsMethod</code>.
All these functions worked the last time I closed eclipse and I'm pretty sure that I didn't change something on anything else except on the <code>onClick</code> method of update button which I was trying to make it work. This doesn' t explain why all other functions don' t work. Can you check if I've accidentally made a crusial mistake chich I don't see?</p>

<p><strong>DataObjectsProvider class:</strong></p>

<pre><code>public class DataObjectsProvider {

  // Database fields
  private SQLiteDatabase database;
  private DbHelper dbHelper;
  private String[] allColumns = { DbHelper.COLUMN_ID,
      DbHelper.COLUMN_SONGNAME, DbHelper.COLUMN_SONGARTIST, 
      DbHelper.COLUMN_SONGGENRE };

  public DataObjectsProvider (Context context) {
        dbHelper = new DbHelper(context);
      }

  public void open() throws SQLException {
        dbHelper.getWritableDatabase();
      }

  public void close() {
        dbHelper.close();
      }

  public DataObjects createDataObjects (String songName, String songArtist, 
          String songGenre) {
       dbHelper.getWritableDatabase();
        ContentValues values = new ContentValues();
        values.put(DbHelper.COLUMN_SONGNAME, songName);
        values.put(DbHelper.COLUMN_SONGARTIST, songArtist);
        values.put(DbHelper.COLUMN_SONGGENRE, songGenre);
        long insertId = database.insert(DbHelper.TABLE_SONGS, null,
                values);
            Cursor cursor = database.query(DbHelper.TABLE_SONGS,
                allColumns, DbHelper.COLUMN_ID + " = " + insertId, null,
                null, null, null);
            cursor.moveToFirst();
            DataObjects newDobject = cursorToDataObjects(cursor);
            cursor.close();
            return newDobject;

      }

  public Cursor fechAllDobjects(){

      Cursor mCursor = database.query(DbHelper.TABLE_SONGS, 
              new String[] {DbHelper.COLUMN_ID,
              DbHelper.COLUMN_SONGNAME, DbHelper.COLUMN_SONGARTIST, 
              DbHelper.COLUMN_SONGGENRE}, 
                null, null, null, null, null);
      if (mCursor != null) {
           mCursor.moveToFirst();
          }
          return mCursor;
  }

  public Cursor fechDobjectsByName(String inputText) throws SQLException {

      Cursor mCursor = null;
      if (inputText == null  ||  inputText.length () == 0)  {
       mCursor = database.query(DbHelper.TABLE_SONGS, 
         new String[] {DbHelper.COLUMN_ID,
         DbHelper.COLUMN_SONGNAME, DbHelper.COLUMN_SONGARTIST, 
         DbHelper.COLUMN_SONGGENRE}, 
         null, null, null, null, null);

      }
      else {
       mCursor = database.query(true, DbHelper.TABLE_SONGS, 
         new String[] {DbHelper.COLUMN_ID,
         DbHelper.COLUMN_SONGNAME, DbHelper.COLUMN_SONGARTIST, 
         DbHelper.COLUMN_SONGGENRE}, 
         DbHelper.COLUMN_SONGNAME + " like '%" + inputText + "%'", null,
         null, null, null, null);
      }
      if (mCursor != null) {
       mCursor.moveToFirst();
      }
      return mCursor;
  }

     /* public void deleteDobjects(DataObjects dobjects) {
            long id = dobjects.getId();
            database.delete(DbHelper.TABLE_SONGS, DbHelper.COLUMN_ID
                + " = " + id, null);

      }*/
      public void DeleteItem(long l)
        {
    dbHelper.getWritableDatabase();
    String query = "DELETE FROM songs WHERE _id="+l;
    database.execSQL(query);
        }

      public void UpdateItem(int id, String songName, String songArtist, String songGenre) {
          dbHelper.getWritableDatabase();
          ContentValues values = new ContentValues();
          values.put(DbHelper.COLUMN_SONGNAME, songName);
          values.put(DbHelper.COLUMN_SONGARTIST, songArtist);
          values.put(DbHelper.COLUMN_SONGGENRE, songGenre);
          database.update(DbHelper.TABLE_SONGS, values, DbHelper.COLUMN_ID +"="+id, null);
      }

      public void deleteAllDobjects() {
          dbHelper.getWritableDatabase();
          database.delete(DbHelper.TABLE_SONGS, null, null);
      }

      public List&lt;DataObjects&gt; getAlldobjects() {
            List&lt;DataObjects&gt; dobjects = new ArrayList&lt;DataObjects&gt;();

            Cursor cursor = database.query(DbHelper.TABLE_SONGS,
                allColumns, null, null, null, null, null); 

            cursor.moveToFirst();
            while (!cursor.isAfterLast()) {
              DataObjects dobject = cursorToDataObjects(cursor);
              dobjects.add(dobject);
              cursor.moveToNext();
            }
            // Make sure to close the cursor
            cursor.close();
            return dobjects;

      }

    private DataObjects cursorToDataObjects(Cursor cursor) {
        DataObjects dobject = new DataObjects();
        dobject.setId(cursor.getLong(0));
        dobject.setSongName(cursor.getString(1));
        dobject.setSongArtist(cursor.getString(2));
        dobject.setSongGenre(cursor.getString(3));
        return dobject;
    }
</code></pre>

<p>}</p>

<p><strong>Database helper class:</strong></p>

<pre><code>public class DbHelper extends SQLiteOpenHelper {


      public static final String TABLE_SONGS = "songs";
      public static final String COLUMN_ID = "_id";
      public static final String COLUMN_SONGNAME = "songname";
      public static final String COLUMN_SONGARTIST = "artist";
      public static final String COLUMN_SONGGENRE = "genre";

      private static final String DATABASE_NAME = "songsdb.db";
      private static final int DATABASE_VERSION = 1;

      // Database creation sql statement
      private static final String DATABASE_CREATE = "create table "
          + TABLE_SONGS + "(" 
          + COLUMN_ID + " integer primary key autoincrement, " 
          + COLUMN_SONGNAME + "," 
          + COLUMN_SONGARTIST + ","
          + COLUMN_SONGGENRE + ");";

      public DbHelper(Context context) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
      }

      @Override
      public void onCreate(SQLiteDatabase database) {
        database.execSQL(DATABASE_CREATE);
      }

      @Override
      public void onUpgrade(SQLiteDatabase database, int oldVersion, int newVersion) {
        Log.w(DbHelper.class.getName(),
            "Upgrading database from version " + oldVersion + " to "
                + newVersion + ", which will destroy all old data");
        database.execSQL("DROP TABLE IF EXISTS " + TABLE_SONGS);
        onCreate(database);
      }
}
</code></pre>

<p>delete database log:</p>

<pre><code>02-15 13:33:13.158: W/dalvikvm(1966): threadid=1: thread exiting with uncaught exception (group=0x40c931f8)
02-15 13:33:13.168: E/AndroidRuntime(1966): FATAL EXCEPTION: main
02-15 13:33:13.168: E/AndroidRuntime(1966): java.lang.NullPointerException
02-15 13:33:13.168: E/AndroidRuntime(1966):     at com.d69.dancesongsdb.DataObjectsProvider.deleteAllDobjects(DataObjectsProvider.java:113)
02-15 13:33:13.168: E/AndroidRuntime(1966):     at com.d69.dancesongsdb.MainActivity$3.onClick(MainActivity.java:102)
02-15 13:33:13.168: E/AndroidRuntime(1966):     at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:166)
02-15 13:33:13.168: E/AndroidRuntime(1966):     at android.os.Handler.dispatchMessage(Handler.java:99)
02-15 13:33:13.168: E/AndroidRuntime(1966):     at android.os.Looper.loop(Looper.java:137)
02-15 13:33:13.168: E/AndroidRuntime(1966):     at android.app.ActivityThread.main(ActivityThread.java:4424)
02-15 13:33:13.168: E/AndroidRuntime(1966):     at java.lang.reflect.Method.invokeNative(Native Method)
02-15 13:33:13.168: E/AndroidRuntime(1966):     at java.lang.reflect.Method.invoke(Method.java:511)
02-15 13:33:13.168: E/AndroidRuntime(1966):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
02-15 13:33:13.168: E/AndroidRuntime(1966):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)
02-15 13:33:13.168: E/AndroidRuntime(1966):     at dalvik.system.NativeStart.main(Native Method)
</code></pre>

<p>insert data log:</p>

<pre><code>02-15 13:35:36.457: W/dalvikvm(2104): threadid=1: thread exiting with uncaught exception (group=0x40c931f8)
02-15 13:35:36.477: E/AndroidRuntime(2104): FATAL EXCEPTION: main
02-15 13:35:36.477: E/AndroidRuntime(2104): java.lang.NullPointerException
02-15 13:35:36.477: E/AndroidRuntime(2104):     at com.d69.dancesongsdb.DataObjectsProvider.createDataObjects(DataObjectsProvider.java:39)
02-15 13:35:36.477: E/AndroidRuntime(2104):     at com.d69.dancesongsdb.MainActivity$2.onClick(MainActivity.java:66)
02-15 13:35:36.477: E/AndroidRuntime(2104):     at android.view.View.performClick(View.java:3511)
02-15 13:35:36.477: E/AndroidRuntime(2104):     at android.view.View$PerformClick.run(View.java:14105)
02-15 13:35:36.477: E/AndroidRuntime(2104):     at android.os.Handler.handleCallback(Handler.java:605)
02-15 13:35:36.477: E/AndroidRuntime(2104):     at android.os.Handler.dispatchMessage(Handler.java:92)
02-15 13:35:36.477: E/AndroidRuntime(2104):     at android.os.Looper.loop(Looper.java:137)
02-15 13:35:36.477: E/AndroidRuntime(2104):     at android.app.ActivityThread.main(ActivityThread.java:4424)
02-15 13:35:36.477: E/AndroidRuntime(2104):     at java.lang.reflect.Method.invokeNative(Native Method)
02-15 13:35:36.477: E/AndroidRuntime(2104):     at java.lang.reflect.Method.invoke(Method.java:511)
02-15 13:35:36.477: E/AndroidRuntime(2104):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
02-15 13:35:36.477: E/AndroidRuntime(2104):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)
02-15 13:35:36.477: E/AndroidRuntime(2104):     at dalvik.system.NativeStart.main(Native Method)
</code></pre>
