I am getting null pointer exception while fetching the data from the SQLite table.
I am getting the null pointer exception when fetching the data using cursor like below Cursor c= db.fetchAllData(); 
 Please have a look at the below precise code, and suggest me some ideas...

`display_transaction.class`

```
public class display_transaction extends Activity {

    DisplayTestDBHelper db;
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.display_listview);

        displayListView();
    }

    public void displayListView() {
        Cursor c= db.fetchAllData();
        String[] columns={db.KEY_ID,db.KEY_DESCRIPTION,db.KEY_AMOUNT};
        int[] id=new int[]{R.id.textView1,R.id.textView2};
        SimpleCursorAdapter s=new SimpleCursorAdapter(this,R.layout.listviewlayout,c,columns,id,0);          

        ListView l=(ListView) findViewById(R.id.listview1);
        l.setAdapter(s);
    }
}

```

`DisplayTestDBHelper.class`

```
public Cursor fetchAllData() {
    String TABLE_NAME="transaction_table";
    SQLiteDatabase db = this.getWritableDatabase();
    Cursor mCursor = db.query(TABLE_NAME, new String[] {KEY_ID, KEY_DESCRIPTION, KEY_AMOUNT}, null, null, null, null, null);

    if (mCursor != null) {
        mCursor.moveToFirst();
    }
    return mCursor;

}

```

Please help me to resolve the above issue...
Thanks in advance!!!!