Esempio n. 1
0
 @Override
 public void updateWord(Word word) {
   Db_Help dbhelper = new Db_Help(mContext);
   String query =
       "UPDATE tb_words SET vocab='"
           + word.getVocab()
           + "'"
           + ",meaning='"
           + word.getMeaning()
           + "',pronunciation='"
           + word.getPronunciation()
           + "' WHERE _id='"
           + word.getId()
           + "'";
   Log.e("DB_QUERY", query);
   dbhelper.executeQuery(query);
 }
Esempio n. 2
0
  @Override
  public void insertWord(Word word) {
    Db_Help dbhelper = new Db_Help(mContext);
    Common_helper common_helper = new Common_helper(mContext);

    String query =
        "INSERT INTO tb_words VALUES ('"
            + common_helper.getGUID()
            + "',"
            + "'"
            + word.getVocab()
            + "',"
            + "'"
            + word.getPronunciation()
            + "',"
            + "'"
            + word.getMeaning()
            + "');";
    Log.e("DB_QUERY", query);
    dbhelper.executeQuery(query);
  }
Esempio n. 3
0
 @Override
 public void deleteAllWord() {
   Db_Help dbhelper = new Db_Help(mContext);
   String query = "DELETE FROM tb_words; ";
   dbhelper.executeQuery(query);
 }
Esempio n. 4
0
 @Override
 public void deleteWord(Word word) {
   Db_Help dbhelper = new Db_Help(mContext);
   String query = "DELETE FROM tb_words where _id='" + word.getId() + "'";
   dbhelper.executeQuery(query);
 }