查
open=new HistoryDAO(this);
dbHelper=new DBConnection(this);
open.open();
SQLiteDatabase db =dbHelper.getWritableDatabase();
Cursor cursor = db.rawQuery("select * from Toolhistory",null);
while (cursor.moveToNext()) {
Content = cursor.getString(cursor.getColumnIndex("content"));
System.out.println("the content is"+ Content);
Toast.makeText(LawTool_City_SearchActivity.this,Content,Toast.LENGTH_SHORT).show();
// title=new String[]{"dsfsd","sdfg"};
}
open.closeAll();
增
open=new HistoryDAO(this);
dbHelper=new DBConnection(this);
open.open();
SQLiteDatabase db =dbHelper.getWritableDatabase();
open.add(content,"Toolhistory");
ContentValues values = new ContentValues();
values.put("content", a);
db.insert("Toolhistory", null, values);
}
open.closeAll();