title: SELECT:ing a row with a id blob using a parameterized query
body: <p>I have a sqlite database where all rows have a UUID as the primary key, the db column is defined as a BLOB. </p>
  
  <p>The keys are inserted as byte[] instead of Strings to avoid wasting <a href="http://wtanaka.com/node/8106" rel="nofollow">storage and index spaces</a>. I can insert, update and delete rows using SQLiteDatabase.compileStatement and using bindBlob on the SQLiteStatement but I can't find anyway to bind a blob to the parameters of a SELECT query.</p>
  
  <p>Both SQLiteDatabase.query and .rawQuery expects my WHERE arguments to be Strings which will never match my byte array blobs. I can find my row if I construct my WHERE manually using a BLOB literal like this:</p>
  
  <pre><code>final Cursor query = db.query(getTableName(),
                                getColumns(),
                                "id = X'" + bytesToHex(getByteArrayFromUUID(id)) + "'" ,
                                null,
                                null,
                                null,
                                null);
  </code></pre>
  
  <p>But then I am vulnerable to SQL injections... </p>
  
  <p>In every other language I have used SQLite in this is not a problem, is there really no way to get a standard prepared SELECT statement with android SQLite?</p>