我自己得到了我的答案。
我修改過的所有方法(粗體):
Cursor c = null;
DBHelper.mStatement = null;
Vector followups = new Vector();
**boolean runFlag = true;**
synchronized (GlobalVariables.lockObject) {
try {
**while(runFlag)**
SELECT EventId,OldTitle,OrderNumber,Status,Title,Type,UpdateDateTime,Id FROM Questions WHERE EventId=5 AND Type=1 AND (Status=0 OR Status=1 OR Status=2) ORDER BY OrderNumber
DBHelper.CreateAndOpenSqliteDBConnection();
DBHelper.mStatement = DBHelper.sqliteDb.createStatement(strQuery);
DBHelper.mStatement.prepare();
**if(DBHelper.mStatement == null)
{
DBHelper.CloseSqliteDBConnection();
runFlag = true;
continue;
}
else
{
runFlag = false;
}**
c = DBHelper.mStatement.getCursor();
while (c.next()) {
followups.addElement(Followup.getFromCursor(c));
}
}
**}**
catch (Exception ex) {
System.out.print(ERRORSTRING + "getUploadFollowupsFromDB: "
+ ex);
} finally {
DBHelper.CloseSqliteDBConnection();
}
GlobalVariables.lockObject.notifyAll();
}
return followups;
大ANKIT Rox的..
您可以包括整個異常消息?此外,包括'strQuery'中出現的實際字符串將會很有幫助。 – 2012-03-31 19:09:54
我的查詢是: SELECT EventId,OldTitle,OrderNumber,Status,Title,Type,UpdateDateTime,Id FROM WHERE EventId = 5 AND Type = 1 AND(狀態= 0或狀態= 1或狀態= 2)ORDER BY OrderNumber 錯誤是:SqlitependingOperation – AnkitRox 2012-04-02 09:32:21
@AnkitRox:請在您的示例中添加更多代碼。這將包括設置'strQuery'等等。另外,正如Michal Donohue所說,請包含完整的錯誤信息,最好包含堆棧跟蹤。 – 2012-04-18 14:44:20