Code example for SQLiteStatement

Methods: bindBlob, executeInsert

0
   * @return the row ID of the last row inserted, if this insert is successful. 
   *         -1 otherwise. 
   */ 
  public long insert_image(Bitmap pic) {
    byte[] byteArr = getBitmapAsByteArray(pic);
    this.insertStmt_image.bindBlob(1, byteArr);
    byte[] hashArr = null;
    try { 
      hashArr = getHashCode(byteArr);
      this.insertStmt_image.bindBlob(2, hashArr);
    } catch (SQLiteException sqlite) {
      Log.e(TAG, sqlite.getMessage().toString());
    } catch (Exception e) {
      Log.e(TAG, e.getMessage().toString());
    } 
    return this.insertStmt_image.executeInsert();
  } 
 
  /** 
   * Add one place record 
   *