当前位置: 首页>>代码示例>>Java>>正文


Java SQLiteException.printStackTrace方法代码示例

本文整理汇总了Java中android.database.sqlite.SQLiteException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java SQLiteException.printStackTrace方法的具体用法?Java SQLiteException.printStackTrace怎么用?Java SQLiteException.printStackTrace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.database.sqlite.SQLiteException的用法示例。


在下文中一共展示了SQLiteException.printStackTrace方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: openDatabase

import android.database.sqlite.SQLiteException; //导入方法依赖的package包/类
/**
 * @throws SQLiteException
 */
public void openDatabase() throws SQLiteException {

    openHelper = new DBOpenHelper(context, MD5Utils.GetMD5Code("kf5_ticket_" + SPUtils.getUserId()) + ".db", null, VERSION);
    try {
        db = openHelper.getWritableDatabase();
    } catch (SQLiteException e) {
        e.printStackTrace();
        db = openHelper.getReadableDatabase();
    }
    boolean isTableExit = tableIsExist(openHelper, DB_TABLE);
    if (!isTableExit) {
        db.execSQL(DB_CREATE);
    }

}
 
开发者ID:Zyj163,项目名称:yyox,代码行数:19,代码来源:KF5SDKtoHelper.java

示例2: onLoadFinished

import android.database.sqlite.SQLiteException; //导入方法依赖的package包/类
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
    if (cursor != null) {
        Set<String> mBookedPrograms = new HashSet();
        while (cursor.moveToNext()) {
            try {
                int idx = cursor.getColumnIndexOrThrow(Field.MD5_ID);
                if (idx != -1) {
                    mBookedPrograms.add(cursor.getString(idx));
                }
            } catch (SQLiteException e) {
                e.printStackTrace();
                return;
            }
        }
        if ((getAdapter() instanceof ChannelDetailExpandableListAdapter) && getAdapter().getChannelLivehallView() != null) {
            getAdapter().getChannelLivehallView().setBookedPrograms(mBookedPrograms);
        }
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:20,代码来源:ChannelBaseFragment.java

示例3: onLoadFinished

import android.database.sqlite.SQLiteException; //导入方法依赖的package包/类
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
    if (cursor != null) {
        Set<String> mBookedPrograms = new HashSet();
        while (cursor.moveToNext()) {
            try {
                int idx = cursor.getColumnIndexOrThrow(Field.MD5_ID);
                if (idx != -1) {
                    mBookedPrograms.add(cursor.getString(idx));
                }
            } catch (SQLiteException e) {
                e.printStackTrace();
                return;
            }
        }
        if (this.mAdapter != null) {
            this.mAdapter.setBookedPrograms(mBookedPrograms);
        }
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:20,代码来源:LiveBookFragment.java

示例4: execute

import android.database.sqlite.SQLiteException; //导入方法依赖的package包/类
public static boolean execute(Worker worker) {
    SQLiteDatabase db = Orm.getDatabase();
    db.beginTransaction();
    try {
        boolean isOk = worker.doTransition(db);
        if (isOk) {
            db.setTransactionSuccessful();
        }
        return isOk;
    } catch(SQLiteException e) {
        e.printStackTrace();
    } finally {
        db.endTransaction();
    }
    return false;
}
 
开发者ID:JackWHLiu,项目名称:jackknife,代码行数:17,代码来源:Transaction.java

示例5: getEntryFromDB

import android.database.sqlite.SQLiteException; //导入方法依赖的package包/类
private boolean getEntryFromDB(ComponentKey cacheKey, CacheEntry entry, boolean lowRes) {
    Cursor c = null;
    try {
        c = mIconDb.query(
            new String[]{lowRes ? IconDB.COLUMN_ICON_LOW_RES : IconDB.COLUMN_ICON,
                    IconDB.COLUMN_LABEL},
            IconDB.COLUMN_COMPONENT + " = ? AND " + IconDB.COLUMN_USER + " = ?",
            new String[]{cacheKey.componentName.flattenToString(),
                    Long.toString(mUserManager.getSerialNumberForUser(cacheKey.user))});
        if (c.moveToNext()) {
            entry.icon = loadIconNoResize(c, 0, lowRes ? mLowResOptions : null);
            entry.isLowResIcon = lowRes;
            entry.title = c.getString(1);
            if (entry.title == null) {
                entry.title = "";
                entry.contentDescription = "";
            } else {
                entry.contentDescription = mUserManager.getBadgedLabelForUser(
                        entry.title, cacheKey.user);
            }
            return true;
        }
    } catch (SQLiteException e) {
        e.printStackTrace();
    } finally {
        if (c != null) {
            c.close();
        }
    }
    return false;
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:32,代码来源:IconCache.java

示例6: ensureDatabase

import android.database.sqlite.SQLiteException; //导入方法依赖的package包/类
synchronized void ensureDatabase() {
    if (mDb != null && mDb.isOpen()) {
        return;
    }
    // Sometimes retrieving the database fails. We do 2 retries: first without database deletion
    // and then with deletion.
    for (int tries = 0; tries < 2; tries++) {
        try {
            if (tries > 0) {
                //delete db and recreate
                deleteDB();
            }
            mDb = getWritableDatabase();
            break;
        } catch (SQLiteException e) {
            e.printStackTrace();
        }
        // Wait before retrying.
        try {
            Thread.sleep(SLEEP_TIME_MS);
        } catch (InterruptedException ie) {
            Thread.currentThread().interrupt();
        }
    }
    if(mDb == null){
        return;
    }

    createTableIfNotExists(mDb);

    mDb.setMaximumSize(mMaximumDatabaseSize);
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:33,代码来源:WXSQLiteOpenHelper.java

示例7: onUpgrade

import android.database.sqlite.SQLiteException; //导入方法依赖的package包/类
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
	try {
		if (newVersion == 7) {
			new Settings(mContext).setUsersNotToNotifyWhenLive(getUsersNotToNotify(db));
		}
	} catch (SQLiteException e) {
		e.printStackTrace();
	}


	db.execSQL(SQL_DELETE_ENTRIES);
	onCreate(db);
	//db.close();
}
 
开发者ID:SebastianRask,项目名称:Pocket-Plays-for-Twitch,代码行数:16,代码来源:SubscriptionsDbHelper.java

示例8: getUsersNotToNotify

import android.database.sqlite.SQLiteException; //导入方法依赖的package包/类
public ArrayList<Integer> getUsersNotToNotify() {
	try {
		return getUsersNotToNotify(getReadableDatabase());
	} catch (SQLiteException e) {
		e.printStackTrace();
		return new ArrayList<>();
	}
}
 
开发者ID:SebastianRask,项目名称:Pocket-Plays-for-Twitch,代码行数:9,代码来源:SubscriptionsDbHelper.java


注:本文中的android.database.sqlite.SQLiteException.printStackTrace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。