public byte[] columnBlob(String columnName) throws SQLiteException { return this.stmt.columnBlob(sqliteQuery.getColumnIndex(columnName)); }
public byte[] columnBlob(String columnName) throws SQLiteException { return this.stmt.columnBlob(sqliteQuery.getColumnIndex(columnName)); }
public byte[] extractSingleBlob() throws SQLiteException { this.stmt.step(); if ( !stmt.hasRow() ) return null; byte[] result = this.stmt.columnBlob(0); this.dispose(); return result; }
public byte[] extractSingleBlob() throws SQLiteException { this.stmt.step(); if ( !stmt.hasRow() ) return null; byte[] result = this.stmt.columnBlob(0); this.dispose(); return result; }
public BoundingBox extractObject(SQLiteStatement stmt) throws SQLiteException, StreamCorruptedException { int bbId = stmt.columnInt(0); byte[] bbBytes = stmt.columnBlob(1); int runSliceId = stmt.columnInt(2); int firstSpectrumId = stmt.columnInt(3); int lastSpectrumId = stmt.columnInt(4); BoundingBox bb = BoundingBoxBuilder.buildBB( bbId, bbBytes, firstSpectrumId, lastSpectrumId, this.spectrumHeaderById, this.dataEncodingBySpectrumId ); bb.setRunSliceId(runSliceId); return bb; }
public BoundingBox extractObject(SQLiteStatement stmt) throws SQLiteException, StreamCorruptedException { int bbId = stmt.columnInt(0); byte[] bbBytes = stmt.columnBlob(1); int runSliceId = stmt.columnInt(2); int firstSpectrumId = stmt.columnInt(3); int lastSpectrumId = stmt.columnInt(4); BoundingBox bb = BoundingBoxBuilder.buildBB( bbId, bbBytes, firstSpectrumId, lastSpectrumId, this.spectrumHeaderById, this.dataEncodingBySpectrumId ); bb.setRunSliceId(runSliceId); return bb; }
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; }
SQLiteConnection sqLiteConnection=null; SQLiteStatement sqLiteStatement=null; try { File databaseFile = context.getDatabasePath("database.db"); sqLiteConnection=new SQLiteConnection(databaseFile); sqLiteConnection.open(); sqLiteStatement=sqLiteConnection.prepare("SELECT blob FROM table WHERE id=?"); sqLiteStatement.bind(1, id); sqLiteStatement.step(); byte[] blob=sqLiteStatement.columnBlob(0); } finally { if(sqLiteStatement!=null) sqLiteStatement.dispose(); if(sqLiteConnection!=null) sqLiteConnection.dispose(); }
return columnString(column); case SQLITE_BLOB: return columnBlob(column); default: Internal.recoverableError(this, "value type " + valueType + " not yet supported", true);