title: Display sqlite data on listview
body: <p>I have to show saved sqlite data on a listview. But only one column's data is enough to show.Here is my codes. I want to get "tarih" column's data.</p>
  
  <pre><code>public class TarihDataSource {
  
  private SQLiteDatabase database;
  private DatabaseOlusturma dbOlustur;
  private String []allColumns = {"tarih","gunluknotu","resim"};
  
  public TarihDataSource(Context context) {
      dbOlustur = new DatabaseOlusturma(context);
  }
  
  public void open() throws SQLException {
      database = dbOlustur.getReadableDatabase();
  }
  
  public void close() {
      dbOlustur.close();
  }
  
  public List&lt;TarihListHelper&gt; getAllTarih() {
      List&lt;TarihListHelper&gt; tarihlistesi = new ArrayList&lt;TarihListHelper&gt;();
      Cursor cursor = database.query("gunluker", allColumns, null, null,
              null, null, null);
      cursor.moveToFirst();
      while (!cursor.isAfterLast()) {
          TarihListHelper comment = cursorToComment(cursor);
          tarihlistesi.add(comment);
          cursor.moveToNext();
      }
      // Make sure to close the cursor
      cursor.close();
      return tarihlistesi;
  }
  
  private TarihListHelper cursorToComment(Cursor cursor) {
      TarihListHelper comment = new TarihListHelper();
      comment.setTarih(cursor.getString(1));
      return comment;
    }
  
  }
  </code></pre>
  
  <p>What is the wrong in this codes?</p>