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