public void prepare(String sql, com.couchbase.lite.internal.database.sqlite.SQLiteStatementInfo outStatementInfo) {
        if (sql == null) {
            throw new IllegalArgumentException("sql must not be null.");
        }

        final int cookie = mRecentOperations.beginOperation("prepare", sql, null);
        try {
            final PreparedStatement statement = acquirePreparedStatement(sql);
            try {
                if (outStatementInfo != null) {
                    outStatementInfo.numParameters = statement.mNumParameters;
                    outStatementInfo.readOnly = statement.mReadOnly;

                    final int columnCount = nativeGetColumnCount(
                            mConnectionPtr, statement.mStatementPtr);
                    if (columnCount == 0) {
                        outStatementInfo.columnNames = EMPTY_STRING_ARRAY;
                    } else {
                        outStatementInfo.columnNames = new String[columnCount];
                        for (int i = 0; i < columnCount; i++) {
                            outStatementInfo.columnNames[i] = nativeGetColumnName(
                                    mConnectionPtr, statement.mStatementPtr, i);
                        }
                    }
                }
            } finally {
                releasePreparedStatement(statement);
            }
        } catch (RuntimeException ex) {
            mRecentOperations.failOperation(cookie, ex);
            throw ex;
        } finally {
            mRecentOperations.endOperation(cookie);
        }
    }
public void prepare ( String sql , com . couchbase . lite . internal . database . sqlite . SQLiteStatementInfo outStatementInfo ) { if ( sql == null ) { throw new IllegalArgumentException ( "sql must not be null." ) ; } final int cookie = mRecentOperations . beginOperation ( "prepare" , sql , null ) ; try { final PreparedStatement statement = acquirePreparedStatement ( sql ) ; try { if ( outStatementInfo != null ) { outStatementInfo . numParameters = statement . mNumParameters ; outStatementInfo . readOnly = statement . mReadOnly ; final int columnCount = nativeGetColumnCount ( mConnectionPtr , statement . mStatementPtr ) ; if ( columnCount == 0 ) { outStatementInfo . columnNames = EMPTY_STRING_ARRAY ; } else { outStatementInfo . columnNames = new String [ columnCount ] ; for ( int i = 0 ; i < columnCount ; i ++ ) { outStatementInfo . columnNames [ i ] = nativeGetColumnName ( mConnectionPtr , statement . mStatementPtr , i ) ; } } } } finally { releasePreparedStatement ( statement ) ; } } catch ( RuntimeException ex ) { mRecentOperations . failOperation ( cookie , ex ) ; throw ex ; } finally { mRecentOperations . endOperation ( cookie ) ; } }
Prepares a statement for execution but does not bind its parameters or execute it.
<p>
This method can be used to check for syntax errors during compilation
prior to execution of the statement.  If the {@code outStatementInfo} argument
is not null, the provided {@link com.couchbase.lite.internal.database.sqlite.SQLiteStatementInfo} object is populated
with information about the statement.
</p><p>
A prepared statement makes no reference to the arguments that may eventually
be bound to it, consequently it it possible to cache certain prepared statements
such as SELECT or INSERT/UPDATE statements.  If the statement is cacheable,
then it will be stored in the cache for later.
</p><p>
To take advantage of this behavior as an optimization, the connection pool
provides a method to acquire a connection that already has a given SQL statement
in its prepared statement cache so that it is ready for execution.
</p>

@param sql The SQL statement to prepare.
@param outStatementInfo The {@link com.couchbase.lite.internal.database.sqlite.SQLiteStatementInfo} object to populate
with information about the statement, or null if none.

@throws com.couchbase.lite.internal.database.sqlite.exception.SQLiteException if an error occurs, such as a syntax error.