예제 #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);
 }