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


Java DatabaseUtils.STATEMENT_SELECT属性代码示例

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


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

示例1: runSql

private void runSql(String sql) {

        hideSoftwareInput(this, clearEditText);
        response_content_layout.setVisibility(View.VISIBLE);

        //查询语句跳转界面,其他直接显示结果
        int sqlType = DatabaseUtils.getSqlStatementType(sql);

        if (sqlType == DatabaseUtils.STATEMENT_SELECT) {

            startTableDataActivity(sql);

        } else {

            try {
                int result = SQLManager.getSQLHelper(SqlCommondActivity.this).execSQLStr(sql);
                response_content.setText(result + "");
            } catch (Exception e) {
                e.printStackTrace();
                response_content.setText(e.getMessage());
            }
        }
    }
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:23,代码来源:SqlCommondActivity.java

示例2: isCacheable

private static boolean isCacheable(int statementType) {
    if (statementType == DatabaseUtils.STATEMENT_UPDATE
            || statementType == DatabaseUtils.STATEMENT_SELECT) {
        return true;
    }
    return false;
}
 
开发者ID:doppllib,项目名称:core-doppl,代码行数:7,代码来源:SQLiteConnection.java

示例3: SQLiteProgram

SQLiteProgram(SQLiteDatabase db, String sql, Object[] bindArgs,
        CancellationSignal cancellationSignalForPrepare) {
    mDatabase = db;
    mSql = sql.trim();

    int n = DatabaseUtils.getSqlStatementType(mSql);
    switch (n) {
        case DatabaseUtils.STATEMENT_BEGIN:
        case DatabaseUtils.STATEMENT_COMMIT:
        case DatabaseUtils.STATEMENT_ABORT:
            mReadOnly = false;
            mColumnNames = EMPTY_STRING_ARRAY;
            mNumParameters = 0;
            break;

        default:
            boolean assumeReadOnly = (n == DatabaseUtils.STATEMENT_SELECT);
            SQLiteStatementInfo info = new SQLiteStatementInfo();
            db.getThreadSession().prepare(mSql,
                    db.getThreadDefaultConnectionFlags(assumeReadOnly),
                    cancellationSignalForPrepare, info);
            mReadOnly = info.readOnly;
            mColumnNames = info.columnNames;
            mNumParameters = info.numParameters;
            break;
    }

    if (bindArgs != null && bindArgs.length > mNumParameters) {
        throw new IllegalArgumentException("Too many bind arguments.  "
                + bindArgs.length + " arguments were provided but the statement needs "
                + mNumParameters + " arguments.");
    }

    if (mNumParameters != 0) {
        mBindArgs = new Object[mNumParameters];
        if (bindArgs != null) {
            System.arraycopy(bindArgs, 0, mBindArgs, 0, bindArgs.length);
        }
    } else {
        mBindArgs = null;
    }
}
 
开发者ID:doppllib,项目名称:core-doppl,代码行数:42,代码来源:SQLiteProgram.java


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