當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。