samedi 21 février 2015

Android sqlite - How to manage a Integer value in where clause

I've a problem with the query to mananage the sqlite database in android.


this is a sample method :



public Cursor selectID( Integer id){
// query code for select
}


But all the query method that i see , not allow me to manage an integer parameter, or anything else except a String parameter. Usually i use the rawQuery method:


for example :



db.rawQuery("Select id from dbName where id = ?", new String[] {id});


But that, as i said , is not possible whit Integer or other parameter ( for example



new Integer[] {id};


How i can do to solve my problem?


Aucun commentaire:

Enregistrer un commentaire