這裏是我要插入值的表:SQLiteException:無法識別的標記: 「」:
" create table if not exists "+CipherCongfigTable +
" (DATABSE_NAME **TEXT** PRIMARY KEY NOT NULL,DATABSE_KEY **TEXT** NOT NULL);";
當我想插入
String **configDBPassword**= "**x\'2DD29CA89\'**"
通過聲明
"insert into "+CipherCongfigTable+ " values("+DataBaseName+","+**configDBPassword**+")"
我收到異常:
無法識別的標記:「\」:
我需要有逃生性格特徵相同的格式,即密碼。有沒有辦法做到這一點?
謝謝
我相信它的java創建問題,請嘗試\\而不是使用準備好的語句 – Panther
爲什麼你使用not [insert()](https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase。 html#insert%28java.lang.String,%20java.lang.String,%20android.content.ContentValues%29),而是通過*沒有正確引用您的參數來創建SQL注入攻擊點。 – dhke