當前位置: 首頁>>代碼示例>>Java>>正文


Java SQLiteConstraintException.printStackTrace方法代碼示例

本文整理匯總了Java中android.database.sqlite.SQLiteConstraintException.printStackTrace方法的典型用法代碼示例。如果您正苦於以下問題:Java SQLiteConstraintException.printStackTrace方法的具體用法?Java SQLiteConstraintException.printStackTrace怎麽用?Java SQLiteConstraintException.printStackTrace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.database.sqlite.SQLiteConstraintException的用法示例。


在下文中一共展示了SQLiteConstraintException.printStackTrace方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: insertAchievementExplorer

import android.database.sqlite.SQLiteConstraintException; //導入方法依賴的package包/類
public boolean insertAchievementExplorer(final Context preferenceContext, String email, int idAchievement) {
    try{
        setAction(false);
        AchievementExplorerRequest achievementExplorerRequest = new AchievementExplorerRequest(email, idAchievement);
        achievementExplorerRequest.requestUpdateAchievements(preferenceContext, new AchievementExplorerRequest.Callback() {
            @Override
            public void callbackResponse(boolean response) {
                setResponse(true);
                setAction(true);
            }

            @Override
            public void callbackResponse(List<Achievement> achievements) {}
        });
    }catch(SQLiteConstraintException exception){
        exception.printStackTrace();
    }

    return true;
}
 
開發者ID:fga-gpp-mds,項目名稱:2016.2-MissaoNascente,代碼行數:21,代碼來源:AchievementController.java

示例2: insertManga

import android.database.sqlite.SQLiteConstraintException; //導入方法依賴的package包/類
public boolean insertManga(Manga manga) {
    SQLiteDatabase db = this.getWritableDatabase();
    ContentValues contentValues = new ContentValues();

    contentValues.put(TABLE_MANGA_NAME, manga.getName());
    contentValues.put(TABLE_MANGA_URL, manga.getUrl());
    contentValues.put(TABLE_MANGA_IMAGE, manga.getImage());
    contentValues.put(TABLE_MANGA_LATEST, manga.getLatest());
    try {
        db.insertOrThrow(TABLE_MANGA, null, contentValues);
    } catch (SQLiteConstraintException e) {
        e.printStackTrace();
        System.out.println("Failed to insert");
        return false;
    }
    System.out.println("inserted");
    return true;
}
 
開發者ID:b1acKr0se,項目名稱:jumpmanga,代碼行數:19,代碼來源:JumpDatabaseHelper.java

示例3: insertRecentChapter

import android.database.sqlite.SQLiteConstraintException; //導入方法依賴的package包/類
public boolean insertRecentChapter(Manga manga, Chapter chapter) {
    SQLiteDatabase db = this.getWritableDatabase();
    deleteRecentChapter(manga.getName());

    ContentValues contentValues = new ContentValues();
    contentValues.put(TABLE_RECENT_MANGA_NAME, manga.getName());
    contentValues.put(TABLE_RECENT_MANGA_IMAGE, manga.getImage());
    contentValues.put(TABLE_RECENT_MANGA_URL, manga.getUrl());
    contentValues.put(TABLE_RECENT_CHAPTER_NAME, chapter.getName());
    contentValues.put(TABLE_RECENT_CHAPTER_URL, chapter.getUrl());

    try {
        db.insertOrThrow(TABLE_RECENT, null, contentValues);
    } catch (SQLiteConstraintException e) {
        e.printStackTrace();
        System.out.println("recent not inserted");
        return false;
    }
    System.out.println("recent inserted");
    return true;
}
 
開發者ID:b1acKr0se,項目名稱:jumpmanga,代碼行數:22,代碼來源:JumpDatabaseHelper.java

示例4: insert

import android.database.sqlite.SQLiteConstraintException; //導入方法依賴的package包/類
public void insert(CustomRules rule)
{
    try
    {
        rulesDao.insert(rule);
    }
    catch (SQLiteConstraintException ex)
    {
        ex.printStackTrace();
    }
}
 
開發者ID:kflauri2312lffds,項目名稱:Android_watch_magpie,代碼行數:12,代碼來源:RulesRepository.java

示例5: insertOrUpdate

import android.database.sqlite.SQLiteConstraintException; //導入方法依賴的package包/類
public void insertOrUpdate(CustomRules rule)
{
    try
    {
        rulesDao.insertOrReplace(rule);
    }
    catch (SQLiteConstraintException ex)
    {
        ex.printStackTrace();
    }
}
 
開發者ID:kflauri2312lffds,項目名稱:Android_watch_magpie,代碼行數:12,代碼來源:RulesRepository.java

示例6: deleteMyCamera

import android.database.sqlite.SQLiteConstraintException; //導入方法依賴的package包/類
public boolean deleteMyCamera(MyCameraInfo myCamera) {
    try {
        mDatabase.execSQL("DELETE FROM MyCamera WHERE IP=? AND PORT=?", new String[]{myCamera.getIP(), myCamera.getPort() + ""});
        return true;
    } catch (SQLiteConstraintException e) {
        e.printStackTrace();
    }
    return false;
}
 
開發者ID:pwrliang,項目名稱:CameraViewer,代碼行數:10,代碼來源:MyCameraDB.java

示例7: saveMyCamera

import android.database.sqlite.SQLiteConstraintException; //導入方法依賴的package包/類
public boolean saveMyCamera(MyCameraInfo myCameraInfo) {
    try {
        mDatabase.execSQL("INSERT INTO MyCamera(IP,PORT,PASSWORD,NOTE,DEVICE_ID,CAM_NUMBER,TYPE) VALUES (?,?,?,?,?,?,?)",
                new String[]{myCameraInfo.getIP(), myCameraInfo.getPort() + "", myCameraInfo.getPassword(), myCameraInfo.getNote(),
                        myCameraInfo.getDeviceId(), myCameraInfo.getCamNumber() + "", myCameraInfo.getType() + ""});
        return true;
    } catch (SQLiteConstraintException e) {
        e.printStackTrace();
    }
    return false;
}
 
開發者ID:pwrliang,項目名稱:CameraViewer,代碼行數:12,代碼來源:MyCameraDB.java

示例8: updateMyCamera

import android.database.sqlite.SQLiteConstraintException; //導入方法依賴的package包/類
public boolean updateMyCamera(String oldIP, int oldPort, MyCameraInfo myCameraInfo) {
    try {
        mDatabase.execSQL("UPDATE MyCamera SET IP=?,PORT=?,PASSWORD=?,NOTE=?,DEVICE_ID=?,CAM_NUMBER=?,TYPE=? WHERE IP=? AND PORT=?", new String[]{
                myCameraInfo.getIP(), myCameraInfo.getPort() + "", myCameraInfo.getPassword(), myCameraInfo.getNote(), myCameraInfo.getDeviceId(), myCameraInfo.getCamNumber() + "", myCameraInfo.getType() + "",
                oldIP, oldPort + ""
        });
        return true;
    } catch (SQLiteConstraintException e) {
        e.printStackTrace();
    }
    return false;
}
 
開發者ID:pwrliang,項目名稱:CameraViewer,代碼行數:13,代碼來源:MyCameraDB.java

示例9: doInBackground

import android.database.sqlite.SQLiteConstraintException; //導入方法依賴的package包/類
@Override
protected Void doInBackground(Void... params) {
    String sql = "INSERT INTO " + TB_USER_SEX + " VALUES(\"" + userId + "\", " + sex
            + ")";
    try {
        db.execSQL(sql);
    } catch (SQLiteConstraintException e) {
        e.printStackTrace();
    }
    db.close();
    return null;
}
 
開發者ID:jewelzqiu,項目名稱:sjtubbs,代碼行數:13,代碼來源:DatabaseHelper.java


注:本文中的android.database.sqlite.SQLiteConstraintException.printStackTrace方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。