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


Java DatabaseErrorHandler类代码示例

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


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

示例1: DataBaseHelper

import io.requery.android.database.DatabaseErrorHandler; //导入依赖的package包/类
DataBaseHelper(Context context, String dataBaseName, int version, SQLiteDatabase.CursorFactory factory, DatabaseErrorHandler error) {
    super(context, dataBaseName, factory, version, error);
    this.context = context;
    this.dataBaseName = dataBaseName;
}
 
开发者ID:gazman-sdk,项目名称:SQLite-Assets-Helper,代码行数:6,代码来源:DataBaseHelper.java

示例2: SQLiteDatabase

import io.requery.android.database.DatabaseErrorHandler; //导入依赖的package包/类
private SQLiteDatabase(SQLiteDatabaseConfiguration configuration,
                       CursorFactory cursorFactory,
                       DatabaseErrorHandler errorHandler) {
    mCursorFactory = cursorFactory;
    mErrorHandler = errorHandler != null ? errorHandler : new DefaultDatabaseErrorHandler();
    mConfigurationLocked = configuration;
}
 
开发者ID:requery,项目名称:sqlite-android,代码行数:8,代码来源:SQLiteDatabase.java

示例3: setDatabaseErrorHandler

import io.requery.android.database.DatabaseErrorHandler; //导入依赖的package包/类
public Builder setDatabaseErrorHandler(DatabaseErrorHandler databaseErrorHandler) {
    this.databaseErrorHandler = databaseErrorHandler;
    return this;
}
 
开发者ID:gazman-sdk,项目名称:SQLite-Assets-Helper,代码行数:5,代码来源:DataBase.java

示例4: openOrCreateDatabase

import io.requery.android.database.DatabaseErrorHandler; //导入依赖的package包/类
/**
 * Equivalent to openDatabase(path, factory, CREATE_IF_NECESSARY, errorHandler).
 */
public static SQLiteDatabase openOrCreateDatabase(String path, CursorFactory factory,
        DatabaseErrorHandler errorHandler) {
    return openDatabase(path, factory, CREATE_IF_NECESSARY, errorHandler);
}
 
开发者ID:requery,项目名称:sqlite-android,代码行数:8,代码来源:SQLiteDatabase.java

示例5: openDatabase

import io.requery.android.database.DatabaseErrorHandler; //导入依赖的package包/类
/**
 * Open the database according to the flags {@link OpenFlags}
 *
 * <p>Sets the locale of the database to the  the system's current locale.
 * Call {@link #setLocale} if you would like something else.</p>
 *
 * <p>Accepts input param: a concrete instance of {@link DatabaseErrorHandler} to be
 * used to handle corruption when sqlite reports database corruption.</p>
 *
 * @param path to database file to open and/or create
 * @param factory an optional factory class that is called to instantiate a
 *            cursor when query is called, or null for default
 * @param flags to control database access mode
 * @param errorHandler the {@link DatabaseErrorHandler} obj to be used to handle corruption
 * when sqlite reports database corruption
 * @return the newly opened database
 * @throws SQLiteException if the database cannot be opened
 */
public static SQLiteDatabase openDatabase(String path,
                                          CursorFactory factory,
                                          @OpenFlags int flags,
                                          DatabaseErrorHandler errorHandler) {
    SQLiteDatabaseConfiguration configuration = new SQLiteDatabaseConfiguration(path, flags);
    SQLiteDatabase db = new SQLiteDatabase(configuration, factory, errorHandler);
    db.open();
    return db;
}
 
开发者ID:requery,项目名称:sqlite-android,代码行数:28,代码来源:SQLiteDatabase.java

示例6: SQLiteOpenHelper

import io.requery.android.database.DatabaseErrorHandler; //导入依赖的package包/类
/**
 * Create a helper object to create, open, and/or manage a database.
 * The database is not actually created or opened until one of
 * {@link #getWritableDatabase} or {@link #getReadableDatabase} is called.
 *
 * <p>Accepts input param: a concrete instance of {@link DatabaseErrorHandler} to be
 * used to handle corruption when sqlite reports database corruption.</p>
 *
 * @param context to use to open or create the database
 * @param name of the database file, or null for an in-memory database
 * @param factory to use for creating cursor objects, or null for the default
 * @param version number of the database (starting at 1); if the database is older,
 *     {@link #onUpgrade} will be used to upgrade the database; if the database is
 *     newer, {@link #onDowngrade} will be used to downgrade the database
 * @param errorHandler the {@link DatabaseErrorHandler} to be used when sqlite reports database
 * corruption, or null to use the default error handler.
 */
public SQLiteOpenHelper(Context context, String name,
                        SQLiteDatabase.CursorFactory factory,
                        int version,
                        DatabaseErrorHandler errorHandler) {
    if (version < 1) throw new IllegalArgumentException("Version must be >= 1, was " + version);

    mContext = context;
    mName = name;
    mFactory = factory;
    mNewVersion = version;
    mErrorHandler = errorHandler;
}
 
开发者ID:requery,项目名称:sqlite-android,代码行数:30,代码来源:SQLiteOpenHelper.java


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