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 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; }
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; }