@Override public Integer call(final SQLiteStatement statement) throws Exception { return statement.columnCount(); } });
private static Row fillRowValues(SQLiteStatement stmt) throws SQLiteException { final int columnCount = stmt.columnCount(); Row row = new Row(columnCount); for (int index = 0; index < columnCount; index++) { row.set(index, new Value(stmt.columnValue(index), cursorValueType(stmt.columnType(index)))); } return row; }
@Override public Integer call() throws SQLiteException { SQLiteStatement stmt = stmt(connectionPtr, statementPtr); return stmt.columnCount(); } });
@Override public Integer call() throws SQLiteException { SQLiteStatement stmt = stmt(connectionPtr, statementPtr); return stmt.columnCount(); } });
@Override public Integer call(final SQLiteStatement statement) throws Exception { return statement.columnCount(); } });
@Override public Integer call(final SQLiteStatement statement) throws Exception { return statement.columnCount(); } });
static List<String> getColumnNames(SQLiteStatement stmt) throws SQLiteException { // Log.v(LOG_TAG, "getColumnNames()"); List<String> columnNames = new ArrayList<String>(); int columnCount = stmt.columnCount(); for (int i = 0; i < columnCount; i++) { columnNames.add(i, stmt.getColumnName(i)); } // Log.v(LOG_TAG, "columnNames:" + columnNames); return columnNames; }
static List<Integer> getColumnTypes(SQLiteStatement stmt) throws SQLiteException { // Log.v(LOG_TAG, "getColumnTypes()"); List<Integer> columnTypes = new ArrayList<Integer>(); int columnCount = stmt.columnCount(); for (int i = 0; i < columnCount; i++) { columnTypes.add(i, mapColumnType(stmt.columnType(i))); } // Log.v(LOG_TAG, "columnTypes:" + columnTypes); return columnTypes; }
public SQLiteQuery(SQLiteConnection connection, String sqlQuery, boolean cacheStmt) throws SQLiteException { super(); this.queryString = sqlQuery; this.stmt = connection.prepare(sqlQuery, cacheStmt); HashMap<String, Integer> colIdxByColName = new HashMap<String, Integer>(); int nbCols = stmt.columnCount(); for (int colIdx = 0; colIdx < nbCols; colIdx++) { String colName = stmt.getColumnName(colIdx); colIdxByColName.put(colName, colIdx); } this.resultDesc = new SQLiteResultDescriptor(colIdxByColName); }
public SQLiteQuery(SQLiteConnection connection, String sqlQuery, boolean cacheStmt) throws SQLiteException { super(); this.queryString = sqlQuery; this.stmt = connection.prepare(sqlQuery, cacheStmt); HashMap<String, Integer> colIdxByColName = new HashMap<String, Integer>(); int nbCols = stmt.columnCount(); for (int colIdx = 0; colIdx < nbCols; colIdx++) { String colName = stmt.getColumnName(colIdx); colIdxByColName.put(colName, colIdx); } this.resultDesc = new SQLiteResultDescriptor(colIdxByColName); }
for(int i = 0; i < st.columnCount(); i++) { objectToRead.put(st.getColumnName(i), st.columnValue(i));
return ""; int columns = st.columnCount(); if (columns == 0) { return "";
@Override public void endWindow() { try { commitStatement.step(); commitStatement.reset(); if (bindings != null) { for (int i = 0; i < bindings.size(); i++) { execStatement.bind(i, bindings.get(i).toString()); } } int columnCount = execStatement.columnCount(); while (execStatement.step()) { HashMap<String, Object> resultRow = new HashMap<String, Object>(); for (int i = 0; i < columnCount; i++) { resultRow.put(execStatement.getColumnName(i), execStatement.columnValue(i)); } this.result.emit(resultRow); } execStatement.reset(); for (SQLiteStatement st : deleteStatements) { st.step(); st.reset(); } } catch (SQLiteException ex) { throw new RuntimeException(ex); } bindings = null; }
@Override public void endWindow() { try { commitStatement.step(); commitStatement.reset(); if (bindings != null) { for (int i = 0; i < bindings.size(); i++) { execStatement.bind(i, bindings.get(i).toString()); } } int columnCount = execStatement.columnCount(); while (execStatement.step()) { HashMap<String, Object> resultRow = new HashMap<String, Object>(); for (int i = 0; i < columnCount; i++) { resultRow.put(execStatement.getColumnName(i), execStatement.columnValue(i)); } this.result.emit(resultRow); } execStatement.reset(); for (SQLiteStatement st : deleteStatements) { st.step(); st.reset(); } } catch (SQLiteException ex) { throw new RuntimeException(ex); } bindings = null; }
Object[] objectToRead = new Object[st.columnCount()]; columnNames = new String[st.columnCount()]; for (int i = 0; i < st.columnCount(); i++) { columnNames[i] = st.getColumnName(i); for (int i = 0; i < st.columnCount(); i++) { objectToRead[i] = st.columnValue(i);
private static Row fillRowValues(SQLiteStatement stmt) throws SQLiteException { final int columnCount = stmt.columnCount(); Row row = new Row(columnCount); for (int index = 0; index < columnCount; index++) { row.set(index, new Value(stmt.columnValue(index), cursorValueType(stmt.columnType(index)))); } return row; }
private static Row fillRowValues(SQLiteStatement stmt) throws SQLiteException { final int columnCount = stmt.columnCount(); Row row = new Row(columnCount); for (int index = 0; index < columnCount; index++) { row.set(index, new Value(stmt.columnValue(index), cursorValueType(stmt.columnType(index)))); } return row; }
private static Row fillRowValues(SQLiteStatement stmt) throws SQLiteException { final int columnCount = stmt.columnCount(); Row row = new Row(columnCount); for (int index = 0; index < columnCount; index++) { row.set(index, new Value(stmt.columnValue(index), cursorValueType(stmt.columnType(index)))); } return row; }
private static Row fillRowValues(SQLiteStatement stmt) throws SQLiteException { final int columnCount = stmt.columnCount(); Row row = new Row(columnCount); for (int index = 0; index < columnCount; index++) { row.set(index, new Value(stmt.columnValue(index), cursorValueType(stmt.columnType(index)))); } return row; }
static Tuple getDataRow(SQLiteStatement stmt) throws SQLiteException { logger.entering("com.cloudant.sync.internal.sqlite.sqlite4java.SQLiteWrapperUtils","getDataRow",stmt); Tuple result = new Tuple(getColumnTypes(stmt)); for (int i = 0; i < stmt.columnCount(); i++) { Integer type = stmt.columnType(i); // Log.v(LOG_TAG, "i: " + i + ", type: " + mapColumnType(type) + ", expected type: " + result.getType(i)); switch (type) { case SQLiteConstants.SQLITE_NULL: result.put(i); break; case SQLiteConstants.SQLITE_TEXT: result.put(i, stmt.columnString(i)); break; case SQLiteConstants.SQLITE_INTEGER: result.put(i, stmt.columnLong(i)); break; case SQLiteConstants.SQLITE_FLOAT: result.put(i, Double.valueOf(stmt.columnDouble(i)).floatValue()); break; case SQLiteConstants.SQLITE_BLOB: result.put(i, stmt.columnBlob(i)); break; default: throw new IllegalArgumentException("Unsupported data type: " + type); } } return result; }