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


Java SQLiteFullException类代码示例

本文整理汇总了Java中android.database.sqlite.SQLiteFullException的典型用法代码示例。如果您正苦于以下问题:Java SQLiteFullException类的具体用法?Java SQLiteFullException怎么用?Java SQLiteFullException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: handleError

import android.database.sqlite.SQLiteFullException; //导入依赖的package包/类
private void handleError(Exception exception) {
    Exception errProcessEx = exFiltrate(exception);

    if (errProcessEx instanceof SQLiteFullException) {
        // If the error is sqLite full exception already, no need to  update it to the database
        // again.
        handleSQLiteFullException((SQLiteFullException) errProcessEx);
    } else {
        // Normal case.
        try {

            model.setStatus(FileDownloadStatus.error);
            model.setErrMsg(exception.toString());

            database.updateError(model.getId(), errProcessEx, model.getSoFar());
        } catch (SQLiteFullException fullException) {
            errProcessEx = fullException;
            handleSQLiteFullException((SQLiteFullException) errProcessEx);
        }
    }

    processParams.setException(errProcessEx);
    onStatusChanged(FileDownloadStatus.error);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:25,代码来源:DownloadStatusCallback.java

示例2: readExceptionFromParcel

import android.database.sqlite.SQLiteFullException; //导入依赖的package包/类
private static final void readExceptionFromParcel(Parcel reply, String msg, int code) {
    switch (code) {
        case 2:
            throw new IllegalArgumentException(msg);
        case 3:
            throw new UnsupportedOperationException(msg);
        case 4:
            throw new SQLiteAbortException(msg);
        case 5:
            throw new SQLiteConstraintException(msg);
        case 6:
            throw new SQLiteDatabaseCorruptException(msg);
        case 7:
            throw new SQLiteFullException(msg);
        case 8:
            throw new SQLiteDiskIOException(msg);
        case 9:
            throw new SQLiteException(msg);
        case 11:
            throw new OperationCanceledException(msg);
        default:
            reply.readException(code, msg);
    }
}
 
开发者ID:kkmike999,项目名称:YuiHatano,代码行数:25,代码来源:ShadowDatabaseUtils.java

示例3: delete

import android.database.sqlite.SQLiteFullException; //导入依赖的package包/类
@Override
public boolean delete()
        throws SQLiteException
{
    try {
        //drop table
        MapContentProviderHelper map = (MapContentProviderHelper) MapBase.getInstance();
        SQLiteDatabase db = map.getDatabase(false);
        String tableDrop = "DROP TABLE IF EXISTS " + mPath.getName();
        db.execSQL(tableDrop);
    } catch (SQLiteFullException e) {
        e.printStackTrace();
    }

    return super.delete();
}
 
开发者ID:nextgis,项目名称:android_maplib,代码行数:17,代码来源:VectorLayer.java

示例4: handleSQLiteFullException

import android.database.sqlite.SQLiteFullException; //导入依赖的package包/类
private void handleSQLiteFullException(final SQLiteFullException sqLiteFullException) {
    final int id = model.getId();
    if (FileDownloadLog.NEED_LOG) {
        FileDownloadLog.d(this, "the data of the task[%d] is dirty, because the SQLite " +
                        "full exception[%s], so remove it from the database directly.",
                id, sqLiteFullException.toString());
    }

    model.setErrMsg(sqLiteFullException.toString());
    model.setStatus(FileDownloadStatus.error);

    database.remove(id);
    database.removeConnections(id);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:15,代码来源:DownloadStatusCallback.java

示例5: performSetItem

import android.database.sqlite.SQLiteFullException; //导入依赖的package包/类
private boolean performSetItem(String key, String value, boolean isPersistent, boolean allowRetryWhenFull) {
    SQLiteDatabase database = mDatabaseSupplier.getDatabase();
    if (database == null) {
        return false;
    }

    WXLogUtils.d(WXSQLiteOpenHelper.TAG_STORAGE, "set k-v to storage(key:" + key + ",value:" + value + ",isPersistent:" + isPersistent + ",allowRetry:" + allowRetryWhenFull + ")");
    String sql = "INSERT OR REPLACE INTO " + WXSQLiteOpenHelper.TABLE_STORAGE + " VALUES (?,?,?,?);";
    SQLiteStatement statement = null;
    String timeStamp = WXSQLiteOpenHelper.sDateFormatter.format(new Date());
    try {
        statement = database.compileStatement(sql);
        statement.clearBindings();
        statement.bindString(1, key);
        statement.bindString(2, value);
        statement.bindString(3, timeStamp);
        statement.bindLong(4, isPersistent ? 1 : 0);
        statement.execute();
        return true;
    } catch (Exception e) {
        WXLogUtils.e(WXSQLiteOpenHelper.TAG_STORAGE, "DefaultWXStorage occurred an exception when execute setItem :" + e.getMessage());
        if (e instanceof SQLiteFullException) {
            if (allowRetryWhenFull && trimToSize()) {
                //try again
                //setItem/setItemPersistent method only allow try once when occurred a sqliteFullException.
                WXLogUtils.d(WXSQLiteOpenHelper.TAG_STORAGE, "retry set k-v to storage(key:" + key + ",value:" + value + ")");
                return performSetItem(key, value, isPersistent, false);
            }
        }

        return false;
    } finally {
        if(statement != null) {
            statement.close();
        }
    }
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:38,代码来源:DefaultWXStorage.java

示例6: printStackTrace

import android.database.sqlite.SQLiteFullException; //导入依赖的package包/类
/**
 * 数据库文件已达到最大空间(数据库已满)
 * 
 * @param e
 */
public static void printStackTrace(String TAG, SQLiteFullException e) {
	if (IsDebug) {
		e.printStackTrace();
	} else {
		logException(TAG, e);
	}
}
 
开发者ID:smartbeng,项目名称:PaoMovie,代码行数:13,代码来源:Logger.java

示例7: writeExceptionToParcel

import android.database.sqlite.SQLiteFullException; //导入依赖的package包/类
/**
 * Special function for writing an exception result at the header of
 * a parcel, to be used when returning an exception from a transaction.
 * exception will be re-thrown by the function in another process
 *
 * @param reply Parcel to write to
 * @param e     The Exception to be written.
 * @see Parcel#writeNoException
 * @see Parcel#writeException
 */
public static final void writeExceptionToParcel(Parcel reply, Exception e) {
    int     code         = 0;
    boolean logException = true;
    if (e instanceof FileNotFoundException) {
        code = 1;
        logException = false;
    } else if (e instanceof IllegalArgumentException) {
        code = 2;
    } else if (e instanceof UnsupportedOperationException) {
        code = 3;
    } else if (e instanceof SQLiteAbortException) {
        code = 4;
    } else if (e instanceof SQLiteConstraintException) {
        code = 5;
    } else if (e instanceof SQLiteDatabaseCorruptException) {
        code = 6;
    } else if (e instanceof SQLiteFullException) {
        code = 7;
    } else if (e instanceof SQLiteDiskIOException) {
        code = 8;
    } else if (e instanceof SQLiteException) {
        code = 9;
    } else if (e instanceof OperationApplicationException) {
        code = 10;
    } else if (e instanceof OperationCanceledException) {
        code = 11;
        logException = false;
    } else {
        reply.writeException(e);
        Log.e(TAG, "Writing exception to parcel", e);
        return;
    }
    reply.writeInt(code);
    reply.writeString(e.getMessage());

    if (logException) {
        Log.e(TAG, "Writing exception to parcel", e);
    }
}
 
开发者ID:kkmike999,项目名称:YuiHatano,代码行数:50,代码来源:ShadowDatabaseUtils.java

示例8: performSetItem

import android.database.sqlite.SQLiteFullException; //导入依赖的package包/类
private boolean performSetItem(String key, String value, boolean isPersistent, boolean allowRetryWhenFull) {
    WXLogUtils.d(WXSQLiteOpenHelper.TAG_STORAGE,"set k-v to storage(key:"+ key + ",value:"+ value+",isPersistent:"+isPersistent+",allowRetry:"+allowRetryWhenFull+")");
    String sql = "INSERT OR REPLACE INTO " + WXSQLiteOpenHelper.TABLE_STORAGE + " VALUES (?,?,?,?);";
    SQLiteStatement statement = mDatabaseSupplier.getDatabase().compileStatement(sql);
    String timeStamp = WXSQLiteOpenHelper.sDateFormatter.format(new Date());
    try {
        statement.clearBindings();
        statement.bindString(1, key);
        statement.bindString(2, value);
        statement.bindString(3, timeStamp);
        statement.bindLong(4, isPersistent ? 1 : 0);
        statement.execute();
        return true;
    } catch (Exception e) {
        WXLogUtils.e(WXSQLiteOpenHelper.TAG_STORAGE,"DefaultWXStorage occurred an exception when execute setItem :" + e.getMessage());
        if(e instanceof SQLiteFullException){
            if(allowRetryWhenFull && trimToSize()){
                //try again
                //setItem/setItemPersistent method only allow try once when occurred a sqliteFullException.
                WXLogUtils.d(WXSQLiteOpenHelper.TAG_STORAGE,"retry set k-v to storage(key:"+key+",value:"+value+")");
                return performSetItem(key,value,isPersistent,false);
            }
        }

        return false;
    } finally {
        statement.close();
    }
}
 
开发者ID:HJ-StevenSun,项目名称:Weex-TestDemo,代码行数:30,代码来源:DefaultWXStorage.java

示例9: setPicture

import android.database.sqlite.SQLiteFullException; //导入依赖的package包/类
public static void setPicture(MediaWrapper m, Bitmap p) {
    Log.d(TAG, "Setting new picture for " + m.getTitle());
    try {
        getInstance().updateMedia(
            m.getUri(),
                mediaColumn.MEDIA_PICTURE,
            p);
    } catch (SQLiteFullException e) {
        Log.d(TAG, "SQLiteFullException while setting picture");
    }
    m.setPictureParsed(true);
}
 
开发者ID:jiaZengShen,项目名称:vlc_android_win,代码行数:13,代码来源:MediaDatabase.java

示例10: setPicture

import android.database.sqlite.SQLiteFullException; //导入依赖的package包/类
public static void setPicture(MediaWrapper m, Bitmap p) {
    Log.d(TAG, "Setting new picture for " + m.getTitle());
    try {
        getInstance().updateMedia(
            m.getUri(),
                INDEX_MEDIA_PICTURE,
            p);
    } catch (SQLiteFullException e) {
        Log.d(TAG, "SQLiteFullException while setting picture");
    }
    m.setPictureParsed(true);
}
 
开发者ID:hanhailong,项目名称:VCL-Android,代码行数:13,代码来源:MediaDatabase.java

示例11: handleSQLiteFullException

import android.database.sqlite.SQLiteFullException; //导入依赖的package包/类
private void handleSQLiteFullException(final SQLiteFullException sqLiteFullException) {
    final int id = model.getId();
    if (FileDownloadLog.NEED_LOG) {
        FileDownloadLog.d(this, "the data of the task[%d] is dirty, because the SQLite "
                        + "full exception[%s], so remove it from the database directly.",
                id, sqLiteFullException.toString());
    }

    model.setErrMsg(sqLiteFullException.toString());
    model.setStatus(FileDownloadStatus.error);

    database.remove(id);
    database.removeConnections(id);
}
 
开发者ID:lingochamp,项目名称:FileDownloader,代码行数:15,代码来源:DownloadStatusCallback.java

示例12: setPicture

import android.database.sqlite.SQLiteFullException; //导入依赖的package包/类
public static void setPicture(Context context, Media m, Bitmap p) {
    Log.d(TAG, "Setting new picture for " + m.getTitle());
    try {
        MediaDatabase.getInstance(context).updateMedia(
            m.getLocation(),
            MediaDatabase.mediaColumn.MEDIA_PICTURE,
            p);
    } catch (SQLiteFullException e) {
        Log.d(TAG, "SQLiteFullException while setting picture");
    }
    m.setPictureParsed(true);
}
 
开发者ID:Tribler,项目名称:tribler-android,代码行数:13,代码来源:Util.java

示例13: delete

import android.database.sqlite.SQLiteFullException; //导入依赖的package包/类
public static void delete(String tableName)
{
    try {
        MapContentProviderHelper map = (MapContentProviderHelper) MapBase.getInstance();
        SQLiteDatabase db = map.getDatabase(true);
        String tableDrop = "DROP TABLE IF EXISTS " + tableName;
        db.execSQL(tableDrop);
    } catch (SQLiteFullException e) {
        e.printStackTrace();
    }
}
 
开发者ID:nextgis,项目名称:android_maplib,代码行数:12,代码来源:FeatureChanges.java

示例14: setPicture

import android.database.sqlite.SQLiteFullException; //导入依赖的package包/类
public static void setPicture(Media m, Bitmap p) {
    Log.d(TAG, "Setting new picture for " + m.getTitle());
    try {
        getInstance().updateMedia(
            m.getLocation(),
            mediaColumn.MEDIA_PICTURE,
            p);
    } catch (SQLiteFullException e) {
        Log.d(TAG, "SQLiteFullException while setting picture");
    }
    m.setPictureParsed(true);
}
 
开发者ID:smyhvae,项目名称:VlcTest,代码行数:13,代码来源:MediaDatabase.java

示例15: onDiskFull

import android.database.sqlite.SQLiteFullException; //导入依赖的package包/类
private void onDiskFull(SQLiteFullException e) {
    mIgnoreWrites = true;
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:4,代码来源:SQLiteCacheHelper.java


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