Пример #1
0
 public void insertSQL(String url, String Key, int good, int bad, int collect) {
   String SQL =
       "insert into "
           + DetailColumn.TABLE_NAME
           + "("
           + DetailColumn.URL
           + ","
           + DetailColumn.KEY
           + ","
           + DetailColumn.GOOD
           + ","
           + DetailColumn.BAD
           + ","
           + DetailColumn.COLLECT
           + ") values('"
           + url
           + "','"
           + Key
           + "','"
           + good
           + "','"
           + bad
           + "','"
           + collect
           + "')";
   dbHelper.ExecSQL(SQL);
 }
Пример #2
0
 /**
  * 更改评价
  *
  * @param id
  * @param good
  * @param bad
  * @param collect
  * @return
  */
 public int updateSQL(int id, int good, int bad, int collect) {
   ContentValues values = new ContentValues();
   values.put(DetailColumn.GOOD, good);
   values.put(DetailColumn.BAD, bad);
   values.put(DetailColumn.COLLECT, collect);
   return dbHelper.update(
       DetailColumn.TABLE_NAME, values, DetailColumn._ID + "=?", new String[] {id + ""});
 }
Пример #3
0
 public Cursor querySQL(String url) {
   String SQL =
       "select * from "
           + DetailColumn.TABLE_NAME
           + " where "
           + DetailColumn.URL
           + "='"
           + url
           + "'";
   return dbHelper.rawQuery(SQL, null);
 }
Пример #4
0
 public void dbClose() {
   dbHelper.closeDb();
 }
Пример #5
0
 public int deleteSQL(int id) {
   return dbHelper.delete(DetailColumn.TABLE_NAME, id);
 }
Пример #6
0
 public DetailDB(Context context) {
   dbHelper = DBHelper.getInstance(context);
 }