当前位置: 首页>>代码示例>>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;未经允许,请勿转载。