db.execSQL("INSERT OR REPLACE INTO 'sms' (sms_id,text) VALUES (10,'__[ ]__|"?___'[email protected]@- '');");
來看,它的源碼,並顯示該行對我說:sqlite的插入特殊字符
SQLiteManager: Likely SQL syntax error: INSERT INTO 'sms' (sms_id,text) VALUES (10,'__[ ]__|"?___'[email protected]@- ''); [ unrecognized token: "@" ]
Exception Name: NS_ERROR_FAILURE
Exception Message: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [mozIStorageConnection.createStatement]
我需要一個代碼插入任何文字與任何符號
navidonline,使用'StringEscapeUtils.escapeSql(串)'詳細描述[StringEscapeUtils](http://commons.apache.org/lang/api-2.1/org/apache/commons/lang/StringEscapeUtils.html) – 2012-03-19 07:56:47
還有一個幫助[在SQLite中轉義字符串](http:// groups.google.com/group/android-developer s/browse_thread /線程/ 819d470eae5b939f?pli = 1) – 2012-03-19 08:00:31